Adding etc, flatpak and rpm-ostree role

This commit is contained in:
2021-09-12 11:47:34 +02:00
parent a9974924f4
commit b85991f285
14 changed files with 258 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
---
- name: Check if BootLoaderSpec is enabled
ansible.builtin.lineinfile:
path: /etc/default/grub
line: 'GRUB_ENABLE_BLSCFG=true'
#regexp: '^GRUB_ENABLE_BLSCFG=[tT]rue'
state: present
check_mode: yes
register: conf
- name: Enable BootLoaderSpec
ansible.builtin.command:
cmd: grub2-switch-to-blscfg
become: yes
when:
- conf.changed != false

View File

@@ -0,0 +1,10 @@
---
- name: Configure firewalld
ansible.posix.firewalld:
service: "{{ item.key }}"
zone: "{{ item.value.zone }}"
state: "{{ item.value.state }}"
immediate: yes
permanent: yes
become: yes
loop: "{{ lookup('dict', etc_firewalld, wantlist=True) }}"

27
roles/etc/tasks/main.yml Normal file
View File

@@ -0,0 +1,27 @@
---
- name: Set hostname
ansible.builtin.hostname:
name: "{{ etc_hostname }}"
use: systemd
become: yes
when: etc_set_hostname | bool
- name: Include users.yml
ansible.builtin.include: users.yml
when: etc_update_users | bool
- name: Include blscfg.yml
ansible.builtin.include: blscfg.yml
when: etc_enable_BLSCFG | bool
- name: Include nts.yml
ansible.builtin.include: nts.yml
when: etc_enable_NTS | bool
- name: Include firewalld.yml
ansible.builtin.include: firewalld.yml
when: etc_configure_firewalld | bool
- name: Include sysctl.yml
ansible.builtin.include: sysctl.yml
when: etc_configure_sysctl | bool

7
roles/etc/tasks/nts.yml Normal file
View File

@@ -0,0 +1,7 @@
---
- name: Enable NTS
ansible.builtin.template:
src: chrony.conf.j2
dest: /etc/chrony.conf
become: yes
notify: Restart chronyd

View File

@@ -0,0 +1,10 @@
---
- name: Configure sysctl
ansible.posix.sysctl:
name: "{{ item.key }}"
value: "{{ item.value.value }}"
state: "{{ item.value.state }}"
sysctl_file: "/etc/sysctl.d/100-custom.conf"
sysctl_set: yes
become: yes
loop: "{{ lookup('dict', etc_sysctl_params, wantlist=True) }}"

View File

@@ -0,0 +1,7 @@
---
- name: Update users
ansible.builtin.user:
name: "{{ item.key }}"
shell: "{{ item.value.shell }}"
become: yes
loop: "{{ lookup('dict', etc_users, wantlist=True) }}"