Skip to content

linuxhq/ansible-collection-linux

Repository files navigation

linuxhq.linux

License Ansible Galaxy Lint Release

A collection of linux roles

Collection

Build

ansible-galaxy collection build

Install

ansible-galaxy collection install linuxhq.linux

Molecule

python3 -m venv venv
source venv/bin/activate
venv/bin/pip3 install -r requirements.txt

Playbook

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([]) }}"

About

A collection of linux roles

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages