Moving to collections instead of modules shipped with Ansible.

This commit is contained in:
Robert de Bock 2021-02-19 14:08:50 +01:00
parent 8244ddde1e
commit bc5d77a50b
4 changed files with 12 additions and 10 deletions

View file

@ -9,4 +9,4 @@
- reboot - reboot
- name: reboot - name: reboot
reboot: ansible.builtin.reboot:

View file

@ -1,3 +1,5 @@
--- ---
roles: roles:
- name: robertdebock.bootstrap - name: robertdebock.bootstrap
collections:
- name: ansible.builtin

View file

@ -1,7 +1,7 @@
--- ---
- name: test if grub_timeout is set correctly - name: test if grub_timeout is set correctly
assert: ansible.builtin.assert:
that: that:
- grub_timeout is defined - grub_timeout is defined
- grub_timeout is number - grub_timeout is number
@ -9,7 +9,7 @@
quiet: yes quiet: yes
- name: test if grub_recordfail_timeout is set correctly - name: test if grub_recordfail_timeout is set correctly
assert: ansible.builtin.assert:
that: that:
- grub_recordfail_timeout is defined - grub_recordfail_timeout is defined
- grub_recordfail_timeout is number - grub_recordfail_timeout is number
@ -17,7 +17,7 @@
quiet: yes quiet: yes
- name: test if grub_options is set correctly - name: test if grub_options is set correctly
assert: ansible.builtin.assert:
that: that:
- grub_options is iterable - grub_options is iterable
quiet: yes quiet: yes
@ -25,7 +25,7 @@
- grub_options is defined - grub_options is defined
- name: test if item in grub_options is set correctly - name: test if item in grub_options is set correctly
assert: ansible.builtin.assert:
that: that:
- item.option is defined - item.option is defined
- item.option is string - item.option is string

View file

@ -7,12 +7,12 @@
delegate_to: localhost delegate_to: localhost
- name: install required packages - name: install required packages
package: ansible.builtin.package:
name: "{{ grub_packages }}" name: "{{ grub_packages }}"
state: present state: present
- name: set GRUB_TIMEOUT - name: set GRUB_TIMEOUT
lineinfile: ansible.builtin.lineinfile:
path: /etc/default/grub path: /etc/default/grub
line: GRUB_TIMEOUT={{ grub_timeout }} line: GRUB_TIMEOUT={{ grub_timeout }}
create: yes create: yes
@ -21,7 +21,7 @@
- update grub - update grub
- name: set GRUB_RECORDFAIL_TIMEOUT - name: set GRUB_RECORDFAIL_TIMEOUT
lineinfile: ansible.builtin.lineinfile:
path: /etc/default/grub path: /etc/default/grub
line: GRUB_RECORDFAIL_TIMEOUT={{ grub_recordfail_timeout }} line: GRUB_RECORDFAIL_TIMEOUT={{ grub_recordfail_timeout }}
create: yes create: yes
@ -30,7 +30,7 @@
- update grub - update grub
- name: add options to GRUB_CMDLINE_LINUX - name: add options to GRUB_CMDLINE_LINUX
replace: ansible.builtin.replace:
path: /etc/default/grub path: /etc/default/grub
regexp: '^GRUB_CMDLINE_LINUX="((:?(?!{{ item.option }}={{ item.value }}).)*?)"$' regexp: '^GRUB_CMDLINE_LINUX="((:?(?!{{ item.option }}={{ item.value }}).)*?)"$'
replace: 'GRUB_CMDLINE_LINUX="\1 {{ item.option }}={{ item.value }}"' replace: 'GRUB_CMDLINE_LINUX="\1 {{ item.option }}={{ item.value }}"'
@ -46,4 +46,4 @@
- grub_options | length > 0 - grub_options | length > 0
- name: flush handlers - name: flush handlers
meta: flush_handlers ansible.builtin.meta: flush_handlers