~xenrox/ansible

149f8bc305eff49d3977463fb054d91a64d5800c — Thorben Günther 2 months ago 9f06257
xenrox: Add second SSH public key

Used for the CI/CD pipeline.
3 files changed, 9 insertions(+), 1 deletions(-)

A public_keys/xenrox_ansible.pub
M roles/xenrox/tasks/main.yml
M roles/xenrox/vars/main.yml
A public_keys/xenrox_ansible.pub => public_keys/xenrox_ansible.pub +1 -0
@@ 0,0 1,1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEz+KVhM3AemmmINxjhqZMYWHxMxIZS0ru0BrBLar7Ew xenrox ansible key

M roles/xenrox/tasks/main.yml => roles/xenrox/tasks/main.yml +5 -1
@@ 30,9 30,13 @@
    append: true
    groups: wheel

- name: Read SSH public keys
  ansible.builtin.set_fact:
    authorized_keys: "{% for key in ssh_pubkeys %}{{ lookup('file', '../public_keys/' + key) }}\n{% endfor %}"

- name: deposit ssh pub key
  ansible.posix.authorized_key:
    user: xenrox
    state: present
    exclusive: true
    key: "{{ lookup('file', '../public_keys/yubikey.pub') }}"
    key: "{{ authorized_keys }}"

M roles/xenrox/vars/main.yml => roles/xenrox/vars/main.yml +3 -0
@@ 2,3 2,6 @@
xenrox_packages:
  - sudo
  - zsh
ssh_pubkeys:
  - yubikey.pub
  - xenrox_ansible.pub