A collection of linux roles
ansible-galaxy collection build
ansible-galaxy collection install linuxhq.linux
- Python
>= 3.13 ansible-core >= 2.18.0ansible.posixcommunity.docker >= 5.0.0community.general >= 12.0.0pycryptodome >= 3.23.0(rclone filter plugins only)
make
source venv/bin/activate
An example playbook utilizing roles available in this collection
- hosts: server
vars:
global_users:
- name: johnd
id: 2000
key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIRtpHq0ih6ZsXzskVMqHLc3bvCp82l1lS/V9i3wXwQQ
- name: janed
id: 2001
key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEQYZwthruEeeRtn4QE2x5xeVosMNha99UOVptoNjVbs
roles:
- role: linuxhq.linux.group
group_list:
"{{ (global_users |
json_query('[].{
name: name,
gid: id
}')) |
d([]) }}"
- role: linuxhq.linux.user
user_list:
"{{ (global_users |
json_query('[].{
name: name,
uid: id
}')) |
d([]) }}"
- role: linuxhq.linux.authorized_key
authorized_key_list:
"{{ (global_users |
json_query('[].{
user: name,
key: key,
exclusive: `true`
}')) |
d([]) }}"