From 0cfbaffefd08e0a42d037cb48b4ece234fe7fa04 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Fri, 19 Feb 2021 14:07:19 +0100 Subject: [PATCH] Moving to collections instead of modules shipped with Ansible. --- handlers/main.yml | 2 +- requirements.yml | 2 ++ tasks/assert.yml | 24 ++++++++++++------------ tasks/main.yml | 6 +++--- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 9c90fb4..23f0b52 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -2,7 +2,7 @@ # handlers file for dhcpd - name: restart dhcpd - service: + ansible.builtin.service: name: "{{ dhcpd_service }}" state: restarted when: diff --git a/requirements.yml b/requirements.yml index 12da3b2..1cc15dd 100644 --- a/requirements.yml +++ b/requirements.yml @@ -3,3 +3,5 @@ roles: - name: robertdebock.apt_autostart - name: robertdebock.bootstrap - name: robertdebock.core_dependencies +collections: + - name: ansible.builtin diff --git a/tasks/assert.yml b/tasks/assert.yml index e7f45cf..c4bcd3e 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -1,14 +1,14 @@ --- - name: test if dhcpd_ipv4_interface is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_ipv4_interface is defined - dhcpd_ipv4_interface is string quiet: yes - name: test if dhcpd_default_lease_time is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_default_lease_time is defined - dhcpd_default_lease_time is number @@ -16,7 +16,7 @@ quiet: yes - name: test if dhcpd_max_lease_time is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_max_lease_time is defined - dhcpd_max_lease_time is number @@ -24,56 +24,56 @@ quiet: yes - name: test if dhcpd_subnet_mask is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_subnet_mask is defined - dhcpd_subnet_mask is string quiet: yes - name: test if dhcpd_broadcast_address is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_broadcast_address is defined - dhcpd_broadcast_address is string quiet: yes - name: test if dhcpd_routers is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_routers is defined - dhcpd_routers is string quiet: yes - name: test if dhcpd_domain_name_servers is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_domain_name_servers is defined - dhcpd_domain_name_servers is string quiet: yes - name: test if dhcpd_domain_search is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_domain_search is defined - dhcpd_domain_search is string quiet: yes - name: test if dhcpd_filename is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_filename is defined - dhcpd_filename is string quiet: yes - name: test if dhcpd_next_server is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_next_server is defined - dhcpd_next_server is string quiet: yes - name: test if dhcpd_subnets is set correctly - assert: + ansible.builtin.assert: that: - dhcpd_subnets is iterable quiet: yes @@ -82,7 +82,7 @@ - dhcpd_subnets is string - name: test if item in dhcpd_subnets is set correctly - assert: + ansible.builtin.assert: that: - item.network is defined - item.network is string diff --git a/tasks/main.yml b/tasks/main.yml index e77eab7..49436c9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,12 +7,12 @@ delegate_to: localhost - name: install dhcpd software - package: + ansible.builtin.package: name: "{{ dhcpd_packages }}" state: present - name: configure defaults - template: + ansible.builtin.template: src: "{{ dhcpd_defaults_src }}" dest: "{{ dhcpd_defaults_dest }}" backup: yes @@ -23,7 +23,7 @@ notify: restart dhcpd - name: configure software - template: + ansible.builtin.template: src: dhcpd.conf.j2 dest: "{{ dhcpd_confdir }}/dhcpd.conf" backup: yes