diff --git a/defaults/main.yml b/defaults/main.yml index 8e02d21c4e6c96caca47d6bec3405fb3bf1877f5..775b1fbc9adde383fed7aec4d70fae7c92a7a7d4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,5 @@ +--- + uptime_mode: main uptime_domain: localhost:8082 uptime_username: uptime diff --git a/tasks/main.yml b/tasks/main.yml index ed3f85a8afbed14dd65d71c6cf9525ceb5bfac45..0697306102670794771d710591744265a70c47bf 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,58 +9,58 @@ - block: - - name: Ensure uptime user - mongodb_user: - database: uptime - login_database: admin - login_user: root - login_password: root - name: root - password: root - ignore_errors: yes - when: uptime_mode == 'main' + - name: Ensure uptime user + mongodb_user: + database: uptime + login_database: admin + login_user: root + login_password: root + name: root + password: root + ignore_errors: yes + when: uptime_mode == 'main' - - name: Ensure directory - file: - path: /var/www - state: directory - mode: 0755 + - name: Ensure directory + file: + path: /var/www + state: directory + mode: 0755 - - name: Checkout latest version of Uptime - git: - repo: https://gitlab.lakedrops.com/tools/uptime.git - dest: /var/www/uptime - force: yes - notify: - - Restart Uptime + - name: Checkout latest version of Uptime + git: + repo: https://gitlab.lakedrops.com/tools/uptime.git + dest: /var/www/uptime + force: yes + notify: + - Restart Uptime - - name: Install node components - npm: - path: /var/www/uptime - notify: - - Restart Uptime + - name: Install node components + npm: + path: /var/www/uptime + notify: + - Restart Uptime - - name: Configure uptime - template: - src: production.yaml - dest: /var/www/uptime/config/production.yaml - owner: root - group: root - mode: 0644 - notify: - - Restart Uptime + - name: Configure uptime + template: + src: production.yaml + dest: /var/www/uptime/config/production.yaml + owner: root + group: root + mode: 0644 + notify: + - Restart Uptime - - name: List Patches - shell: ls /var/www/uptime/patches -1 - register: patch_list + - name: List Patches + shell: ls /var/www/uptime/patches -1 + register: patch_list - - name: Apply Patches - shell: patch -p1 --ignore-whitespace --forward < /var/www/uptime/patches/{{ item }} - args: - chdir: /var/www/uptime - with_items: '{{ patch_list.stdout_lines }}' - ignore_errors: yes - notify: - - Restart Uptime + - name: Apply Patches + shell: patch -p1 --ignore-whitespace --forward < /var/www/uptime/patches/{{ item }} + args: + chdir: /var/www/uptime + with_items: '{{ patch_list.stdout_lines }}' + ignore_errors: yes + notify: + - Restart Uptime when: not excluded_roles or "uptime" not in excluded_roles