Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop generating cloudadmin ssh keys #286

Merged
merged 1 commit into from
Oct 23, 2024
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
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:
- 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:
- 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:
- 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
Loading