From 73bcd67d63a252ab9502846c74bfa50e11105d44 Mon Sep 17 00:00:00 2001 From: Ahmad Wilson Date: Sun, 9 Feb 2020 22:08:19 -0500 Subject: [PATCH] update supported Ansible minimum version and apply refactorizations --- handlers/main.yml | 2 ++ kitchen.yml | 10 ++++------ tasks/common/install/archive_install.yml | 2 +- tasks/common/preflight.yml | 3 +-- tasks/main.yml | 10 ---------- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index a8efbf2..3964e92 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -14,6 +14,7 @@ state: stopped enabled: false listen: Uninstall service + ignore_errors: true - name: Remove Lotus systemd service file become: true @@ -29,6 +30,7 @@ state: stopped enabled: false listen: Uninstall service + ignore_errors: true - name: Remove Lotus storage miner systemd service file become: true diff --git a/kitchen.yml b/kitchen.yml index 00d31fa..b03e0af 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -23,12 +23,14 @@ transport: provisioner: hosts: test-kitchen name: ansible_playbook - require_chef_for_busser: false - require_ruby_for_busser: false + require_pip: true + ansible_version: 2.9.4 ansible_verbose: true ansible_cfg_path: test/ansible.cfg requirements_path: test/requirements-test.yml idempotency_test: true + require_chef_for_busser: false + require_ruby_for_busser: false verifier: name: inspec @@ -46,8 +48,6 @@ platforms: - sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config - systemctl enable sshd.service - yum -y install python-pip - provisioner: - require_pip: true - name: fedora-31 driver_config: <<: *default_driver_config @@ -55,8 +55,6 @@ platforms: - sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config - systemctl enable sshd.service - yum -y install python-pip - provisioner: - require_pip: true - name: ubuntu-18.04 driver_config: <<: *default_driver_config diff --git a/tasks/common/install/archive_install.yml b/tasks/common/install/archive_install.yml index 47e61fe..3c901c0 100644 --- a/tasks/common/install/archive_install.yml +++ b/tasks/common/install/archive_install.yml @@ -5,7 +5,7 @@ get_url: url: "{{ archive_url }}" dest: "/tmp/{{ archive_url | urlsplit('path') | basename }}" - checksum: "{{ checksum_format }}:{{ archive_checksum }}" + checksum: "{{ (archive_checksum|length > 0) | ternary(checksum_format+':'+archive_checksum, '') }}" mode: '0775' register: archive_tmp tags: diff --git a/tasks/common/preflight.yml b/tasks/common/preflight.yml index edf5edf..7898f0a 100644 --- a/tasks/common/preflight.yml +++ b/tasks/common/preflight.yml @@ -16,10 +16,9 @@ command: /bin/true notify: - Uninstall service - rescue: + always: - name: Ensure flush of handlers meta: flush_handlers - always: - name: End play following uninstallation meta: end_play tags: diff --git a/tasks/main.yml b/tasks/main.yml index 1fbce51..a31f21a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,16 +4,6 @@ tags: - preflight -- name: Include OS and distribution specific installation tasks. - include_tasks: "{{ item }}" - with_first_found: - - files: - - "{{ ansible_distribution|lower }}/install.yml" - - "{{ ansible_os_family|lower }}/install.yml" - skip: true - tags: - - install - - name: Include common installation tasks include_tasks: "common/install.yml" tags: