diff --git a/playbooks/acs.yml b/playbooks/acs.yml index 2fb0a7a36..44168956c 100644 --- a/playbooks/acs.yml +++ b/playbooks/acs.yml @@ -6,14 +6,14 @@ ansible.builtin.import_playbook: secrets.yml - hosts: all:!external - gather_facts: false + gather_facts: no tasks: - name: Gather facts from all hosts ansible.builtin.setup: - name: Database Role hosts: database - gather_facts: false + gather_facts: no roles: - role: "../roles/postgres" when: repo_db_url == "" or sync_db_url == "" @@ -27,7 +27,7 @@ - name: Activemq Role hosts: activemq - gather_facts: false + gather_facts: no roles: - role: "../roles/activemq" when: not groups.external_activemq | default([]) @@ -36,16 +36,16 @@ - name: Transformers Role hosts: transformers - gather_facts: false + gather_facts: no roles: - role: "../roles/transformers" post_tasks: - name: update installation status file with Transformers - become: true + become: yes vars: transform_components: transform: "{{ transform }}" - blockinfile: + ansible.builtin.blockinfile: block: "{{ transform_components | to_nice_yaml(indent=2) }}" create: yes path: "{{ ansible_installation_status_file }}" @@ -56,21 +56,21 @@ - name: Alfresco Search Role hosts: search - gather_facts: false + gather_facts: no roles: - role: "../roles/search" post_tasks: - name: make sure Solr is running - become: true + become: yes service: name: alfresco-search state: started - name: update installation status file with Search - become: true + become: yes vars: search_components: search: "{{ search }}" - blockinfile: + ansible.builtin.blockinfile: block: "{{ search_components | to_nice_yaml(indent=2) }}" create: yes path: "{{ ansible_installation_status_file }}" @@ -81,18 +81,18 @@ - name: Alfresco Repository Role hosts: repository - gather_facts: false + gather_facts: no roles: - role: "../roles/repository" post_tasks: - name: update installation status file with ACS - become: true + become: yes vars: acs_components: acs: "{{ acs }}" amps: "{{ amps }}" api_explorer: "{{ api_explorer }}" - blockinfile: + ansible.builtin.blockinfile: block: "{{ acs_components | to_nice_yaml(indent=2) }}" create: yes path: "{{ ansible_installation_status_file }}" @@ -103,17 +103,17 @@ - name: T-Router Role hosts: transformers - gather_facts: false + gather_facts: no roles: - role: "../roles/trouter" when: acs.edition == "Enterprise" post_tasks: - name: update installation status file with Trouter - become: true + become: yes vars: trouter_components: trouter: "{{ trouter }}" - blockinfile: + ansible.builtin.blockinfile: block: "{{ trouter_components | to_nice_yaml(indent=2) }}" create: yes path: "{{ ansible_installation_status_file }}" @@ -124,17 +124,17 @@ - name: Shared File Store Role hosts: transformers - gather_facts: false + gather_facts: no roles: - role: "../roles/sfs" when: acs.edition == "Enterprise" post_tasks: - name: update installation status file with SFS - become: true + become: yes vars: sfs_components: sfs: "{{ sfs }}" - blockinfile: + ansible.builtin.blockinfile: block: "{{ sfs_components | to_nice_yaml(indent=2) }}" create: yes path: "{{ ansible_installation_status_file }}" @@ -145,17 +145,17 @@ - name: Alfresco Digital Workspace Role hosts: adw - gather_facts: false + gather_facts: no roles: - role: "../roles/adw" when: acs.edition == "Enterprise" post_tasks: - name: update installation status file with ADW - become: true + become: yes vars: adw_components: adw: "{{ adw }}" - blockinfile: + ansible.builtin.blockinfile: block: "{{ adw_components | to_nice_yaml(indent=2) }}" create: yes path: "{{ ansible_installation_status_file }}" @@ -166,12 +166,12 @@ - name: Nginx Role hosts: nginx - gather_facts: false + gather_facts: no roles: - role: "../roles/nginx" post_tasks: - name: make sure NGINX is running - become: true + become: yes service: name: nginx state: started @@ -180,17 +180,17 @@ - name: Sync Service Role hosts: syncservice - gather_facts: false + gather_facts: no roles: - role: "../roles/sync" when: acs.edition == "Enterprise" post_tasks: - name: update installation status file with Sync - become: true + become: yes vars: sync_components: sync: "{{ sync }}" - blockinfile: + ansible.builtin.blockinfile: block: "{{ sync_components | to_nice_yaml(indent=2) }}" create: yes path: "{{ ansible_installation_status_file }}" diff --git a/playbooks/check-versions.yml b/playbooks/check-versions.yml index c5d742659..4d1739fd9 100644 --- a/playbooks/check-versions.yml +++ b/playbooks/check-versions.yml @@ -2,19 +2,19 @@ - hosts: localhost tasks: - name: Fail if Ansible version is too old - fail: + ansible.builtin.fail: msg: - "Installed Ansible version is too old. Upgrade to at least 2.12." - "Please refer to https://github.com/Alfresco/alfresco-ansible-deployment/blob/master/docs/deployment-guide.md#setup-a-control-node for detailed instructions." when: (ansible_version.major < 2) or (ansible_version.major == 2 and ansible_version.minor < 12) - name: Check Jinja2 version - shell: | + ansible.builtin.shell: | JINJA_VERSION=$(pip3 freeze | grep Jinja2 | sed 's/Jinja2==//g') echo $JINJA_VERSION register: jinja2_version - name: Fail if Jinja2 version is too old - fail: + ansible.builtin.fail: msg: - "Installed Jinja2 major version is too old. Upgrade to at least version 3." - "Please refer to https://github.com/Alfresco/alfresco-ansible-deployment/blob/master/docs/deployment-guide.md#setup-a-control-node for detailed instructions." diff --git a/playbooks/platform-cleanup.yml b/playbooks/platform-cleanup.yml index 8255fc67d..e52bb0ef3 100644 --- a/playbooks/platform-cleanup.yml +++ b/playbooks/platform-cleanup.yml @@ -3,7 +3,7 @@ - hosts: all vars: artifacts_path: "{{ download_location | default('/tmp/ansible_artefacts') }}" - become: false + become: no tasks: - name: To display warning debug: diff --git a/playbooks/platform-restart.yml b/playbooks/platform-restart.yml index 1a022eb83..cb7382aac 100644 --- a/playbooks/platform-restart.yml +++ b/playbooks/platform-restart.yml @@ -1,7 +1,7 @@ --- - hosts: adw gather_facts: no - become: true + become: yes tasks: - name: Stop Alfresco Digital Workspace service: @@ -13,7 +13,7 @@ - hosts: nginx gather_facts: no - become: true + become: yes tasks: - name: Stop Reverse Proxy service: @@ -25,7 +25,7 @@ - hosts: syncservice gather_facts: no - become: true + become: yes tasks: - name: Stop Alfresco Sync services service: @@ -37,7 +37,7 @@ - hosts: search gather_facts: no - become: true + become: yes tasks: - name: Stop Alfresco Search services service: @@ -49,7 +49,7 @@ - hosts: repository gather_facts: no - become: true + become: yes tasks: - name: Stop Alfresco Content services service: @@ -61,7 +61,7 @@ - hosts: transformers gather_facts: no - become: true + become: yes tasks: - name: Stop Alfresco Transformation services service: @@ -76,7 +76,7 @@ - stop - hosts: database - become: true + become: yes tasks: - name: Stop PostgreSQL service: @@ -88,7 +88,7 @@ - hosts: activemq gather_facts: no - become: true + become: yes tasks: - name: Stop ActiveMQ service: @@ -100,7 +100,7 @@ - hosts: activemq gather_facts: no - become: true + become: yes tasks: - name: Start ActiveMQ service: @@ -111,7 +111,7 @@ - start - hosts: database - become: true + become: yes tasks: - name: Start PostgreSQL service: @@ -123,7 +123,7 @@ - hosts: transformers gather_facts: no - become: true + become: yes tasks: - name: Start Alfresco Transformation services service: @@ -139,7 +139,7 @@ - hosts: repository gather_facts: no - become: true + become: yes tasks: - name: Start Alfresco Content services service: @@ -151,7 +151,7 @@ - hosts: search gather_facts: no - become: true + become: yes tasks: - name: Start Alfresco Search services service: @@ -163,7 +163,7 @@ - hosts: syncservice gather_facts: no - become: true + become: yes tasks: - name: Start Alfresco Sync services service: @@ -175,7 +175,7 @@ - hosts: nginx gather_facts: no - become: true + become: yes tasks: - name: Start Reverse Proxy service: diff --git a/playbooks/platform-uninstall.yml b/playbooks/platform-uninstall.yml index 26a3b5a0c..27614cdb5 100644 --- a/playbooks/platform-uninstall.yml +++ b/playbooks/platform-uninstall.yml @@ -1,8 +1,8 @@ --- #### This playbook will uninstall ACS - hosts: database - become: true - ignore_unreachable: true + become: yes + ignore_unreachable: yes tasks: - name: Removing the Packages ansible.builtin.package: @@ -11,13 +11,13 @@ autoremove: yes - hosts: activemq - become: true - ignore_unreachable: true + become: yes + ignore_unreachable: yes handlers: - - import_tasks: "handlers/uninstall-handlers.yml" + - ansible.builtin.import_tasks: "handlers/uninstall-handlers.yml" tasks: - name: Stopping activemq service - ignore_errors: true + ignore_errors: yes ansible.builtin.service: name: activemq state: stopped @@ -38,13 +38,13 @@ notify: Reload systemd - hosts: transformers - become: true - ignore_unreachable: true + become: yes + ignore_unreachable: yes handlers: - - import_tasks: "handlers/uninstall-handlers.yml" + - ansible.builtin.import_tasks: "handlers/uninstall-handlers.yml" tasks: - name: Stopping transform - ignore_errors: true + ignore_errors: yes ansible.builtin.service: name: "{{ item }}" state: stopped @@ -79,13 +79,13 @@ notify: Reload systemd - hosts: search - become: true - ignore_unreachable: true + become: yes + ignore_unreachable: yes handlers: - - import_tasks: "handlers/uninstall-handlers.yml" + - ansible.builtin.import_tasks: "handlers/uninstall-handlers.yml" tasks: - name: Stopping Search - ignore_errors: true + ignore_errors: yes ansible.builtin.service: name: alfresco-search state: stopped @@ -105,13 +105,13 @@ notify: Reload systemd - hosts: syncservice - become: true - ignore_unreachable: true + become: yes + ignore_unreachable: yes handlers: - - import_tasks: "handlers/uninstall-handlers.yml" + - ansible.builtin.import_tasks: "handlers/uninstall-handlers.yml" tasks: - name: Stopping Sync - ignore_errors: true + ignore_errors: yes ansible.builtin.service: name: alfresco-sync state: stopped @@ -131,8 +131,8 @@ notify: Reload systemd - hosts: nginx - become: true - ignore_unreachable: true + become: yes + ignore_unreachable: yes tasks: - name: Removing the Packages ansible.builtin.package: @@ -141,13 +141,13 @@ autoremove: yes - hosts: repository - become: true - ignore_unreachable: true + become: yes + ignore_unreachable: yes handlers: - - import_tasks: "handlers/uninstall-handlers.yml" + - ansible.builtin.import_tasks: "handlers/uninstall-handlers.yml" tasks: - name: stopping content services - ignore_errors: true + ignore_errors: yes ansible.builtin.service: name: alfresco-content state: stopped diff --git a/playbooks/prerequisite_checks.yml b/playbooks/prerequisite_checks.yml index 0298f773c..17177bcf3 100644 --- a/playbooks/prerequisite_checks.yml +++ b/playbooks/prerequisite_checks.yml @@ -1,7 +1,7 @@ --- - name: prerequisite checks hosts: repository - become: true + become: yes roles: - role: '../roles/helper_modules' tasks: @@ -51,7 +51,7 @@ - name: prerequisite checks hosts: search - become: true + become: yes roles: - role: '../roles/helper_modules' tasks: @@ -64,7 +64,7 @@ - name: prerequisite checks hosts: transformers - become: true + become: yes roles: - role: '../roles/helper_modules' tasks: @@ -77,7 +77,7 @@ - name: prerequisite checks hosts: syncservice - become: true + become: yes roles: - role: '../roles/helper_modules' tasks: @@ -96,7 +96,7 @@ - name: prerequisite checks hosts: adw - become: true + become: yes roles: - role: '../roles/helper_modules' tasks: @@ -109,7 +109,7 @@ - name: prerequisite checks hosts: nginx - become: true + become: yes roles: - role: '../roles/helper_modules' tasks: