From 7df7ca764e704af9d4859e5865e56e3e0327f008 Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 29 Nov 2020 17:53:24 -0600 Subject: [PATCH] All tasks now use FQCN --- README.md | 2 +- handlers/main.yml | 6 +++++- tasks/Debian-default.yml | 8 +++++--- tasks/RedHat-6-default.yml | 11 ++++++++--- tasks/main.yml | 5 +++-- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 225dd44..ec1f301 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Including an example of how to use your role (for instance, with variables passe License ------- -BSD +LGPL-3.0-or-later Author Information ------------------ diff --git a/handlers/main.yml b/handlers/main.yml index 86780b6..58ad924 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,2 +1,6 @@ --- -# handlers file for ensure_ansible_prereq \ No newline at end of file +# handlers file for ensure_ansible_prereq +- name: 'ensure_ansible_prereq.package_facts' + ansible.builtin.package_facts: +- name: 'ensure_ansible_prereq.service_facts' + ansible.builtin.service_facts: diff --git a/tasks/Debian-default.yml b/tasks/Debian-default.yml index 3ae47f9..5d8cd3f 100644 --- a/tasks/Debian-default.yml +++ b/tasks/Debian-default.yml @@ -1,11 +1,11 @@ --- # tasks file for ensure_ansible_prereq - name: 'repository changes' - apt_repository: + ansible.builtin.apt_repository: repo: 'deb cdrom:*' state: absent - name: 'package states' - package: + ansible.builtin.package: name: '{{ item.name }}' state: '{{ item.state }}' loop: @@ -15,4 +15,6 @@ state: 'present' loop_control: label: '{{ item.name }} will be {{ item.state }}' - + notify: + - 'ensure_ansible_prereq.package_facts' + - 'ensure_ansible_prereq.service_facts' diff --git a/tasks/RedHat-6-default.yml b/tasks/RedHat-6-default.yml index 4761033..ad8f599 100644 --- a/tasks/RedHat-6-default.yml +++ b/tasks/RedHat-6-default.yml @@ -1,7 +1,7 @@ --- # tasks file for ensure_ansible_prereq - name: 'package states' - package: + ansible.builtin.package: name: '{{ item.name }}' state: '{{ item.state }}' loop: @@ -9,8 +9,11 @@ state: 'present' loop_control: label: '{{ item.name }} will be {{ item.state }}' + notify: + - 'ensure_ansible_prereq.package_facts' + - 'ensure_ansible_prereq.service_facts' - name: 'service states' - service: + ansible.builtin.service: enabled: '{{ item.enabled }}' name: '{{ item.name }}' state: '{{ item.state }}' @@ -20,4 +23,6 @@ state: 'started' loop_control: label: '{{ item.name }} will be {{ item.state }}' - + notify: + - 'ensure_ansible_prereq.package_facts' + - 'ensure_ansible_prereq.service_facts' diff --git a/tasks/main.yml b/tasks/main.yml index 1cdb6ab..aeb5081 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,7 +3,7 @@ - name: 'include variables' when: - ansible_system == 'Linux' - include_tasks: + ansible.builtin.include_tasks: file: '{{ lookup("first_found", findme ) }}' vars: findme: @@ -16,4 +16,5 @@ - '{{ ansible_os_family }}-default.yml' - 'default.yml' errors: 'ignore' - +- name: 'flush handlers' + ansible.builtin.meta: 'flush_handlers'