Skip to content

Commit

Permalink
Stop generating cloudadmin ssh keys
Browse files Browse the repository at this point in the history
Move all tasks to generate and exchange ssh keys for cloudadmin under a
always false variable. So only leave the ssh keys for root.
  • Loading branch information
mpagot committed Oct 18, 2024
1 parent 7a4a639 commit c6ccb6a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ansible/playbooks/pre-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
- name: Cluster preparation
hosts: all
remote_user: cloudadmin
vars:
crm_rootless: false
pre_tasks:
- name: Detect cloud platform
ansible.builtin.include_tasks:
Expand Down Expand Up @@ -37,7 +39,9 @@
owner: "{{ ansible_user }}"
group: users
mode: '0700'
when: inventory_hostname in groups.hana
when:

Check failure on line 42 in ansible/playbooks/pre-cluster.yaml

View workflow job for this annotation

GitHub Actions / build

42:12 [trailing-spaces] trailing spaces
- inventory_hostname in groups.hana
- crm_rootless

- name: Generate public/private keys for root on hana hosts
become: true
Expand All @@ -61,7 +65,9 @@
type: rsa
size: 4096
register: ssh_user_keys
when: inventory_hostname in groups.hana
when:

Check failure on line 68 in ansible/playbooks/pre-cluster.yaml

View workflow job for this annotation

GitHub Actions / build

68:12 [trailing-spaces] trailing spaces
- inventory_hostname in groups.hana
- crm_rootless

- name: Apply root key to root Authorised Keys
become: true
Expand All @@ -80,7 +86,11 @@
user: "{{ ansible_user }}"
state: present
key: "{{ hostvars[item].ssh_user_keys.public_key }}"
when: inventory_hostname in groups.hana and hostvars[item]['ansible_hostname'] in groups.hana and ansible_hostname != item
when:

Check failure on line 89 in ansible/playbooks/pre-cluster.yaml

View workflow job for this annotation

GitHub Actions / build

89:12 [trailing-spaces] trailing spaces
- inventory_hostname in groups.hana
- hostvars[item]['ansible_hostname'] in groups.hana
- ansible_hostname != item
- crm_rootless
with_items: "{{ groups['all'] }}"

- name: Slurp ssh daemon public key
Expand Down

0 comments on commit c6ccb6a

Please sign in to comment.