Create a linux package_manager role.

This commit is contained in:
Tom Alexander
2022-10-15 22:49:05 -04:00
parent e3b706cb61
commit 9ed2e209fd
11 changed files with 811 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
- name: Put in custom config directory
copy:
src: "files/{{ pacman_conf }}/pacman.conf"
dest: /etc/pacman.conf
mode: 0644
owner: root
group: root
- name: Put in mirrolist
copy:
src: "files/{{ pacman_conf }}/mirrorlist"
dest: /etc/pacman.d/mirrorlist
mode: 0644
owner: root
group: root
- name: Create pacman conf directory
file:
name: /etc/pacman.d/conf.d
state: directory
owner: root
group: root
mode: 0755
- name: Check that paths exist
stat:
path: "{{ item }}"
register: file_exists
no_log: True
loop:
- /etc/pacman.d/conf.d/blank.conf
- name: Create blank file to match glob
file:
name: "{{ item }}"
state: touch
owner: root
group: root
mode: 0644
loop:
- /etc/pacman.d/conf.d/blank.conf
when: "{{ file_exists | community.general.json_query(sub_query) | first | default(False) }} == False"
vars:
sub_query: "results[?stat.path=='{{ item }}'].stat.exists"
- name: Additional pacman configs
copy:
src: "files/{{ item }}"
dest: /etc/pacman.d/conf.d/
mode: 0644
owner: root
group: root
loop:
- freeze_firefox.conf