Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ansible/ca-cert.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# An ansible playbook to configure the SSHD configuration to enable CA cert auth for SSH.
# Remember to export CI_CLOUD if it isn't part of your environment's variables.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? How are you running this playbook?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we need to talk about where this is included in site.yml, there's a bigger job/discussion here than just adding a playbook I think.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI_CLOUD is only required if you're using app creds. Playbooks aren't the place to document the wriggles of authing to openstack TBH.


# NOTE: Change the src for the `ssh_signing_key.pub` to be your corresponding directory.

- hosts: login
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally we'd have a group for the feature, but I'm not clear on which feature this actually belongs to. I suggested login to @MaxBed4d understanding this was a one-off play running against an already-deployed cluster. But that wouldn't be a PR ...

gather_facts: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like you need facts, so I'd turn it off or at least leave it out (which will default to on, but at least you're not documenting that you need something you don't).

become: true
tasks:
- name: Copy ssh public key
ansible.builtin.copy:
src: /var/lib/rocky/conch/ssh_signing_key.pub
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this getting configured? You just created this by hand right?

dest: /etc/ssh/ca_user_key.pub
owner: root
group: root
mode: '0644'
remote_src: true

- name: Ensure CA Certs are accepted
ansible.builtin.lineinfile:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a regexp: line to make it idempotent? E.g. if its already there, but commented out?

line: 'TrustedUserCAKeys /etc/ssh/ca_user_key.pub'
dest: /etc/ssh/sshd_config

- name: Restart SSH service
ansible.builtin.systemd:
name: sshd
state: restarted
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on how this should actually be integrated, this might need gating somehow

Loading