Skip to content

Commit e8da764

Browse files
committed
var key in passwordless and fix sync of olam secret
1 parent 4fde62a commit e8da764

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

olam/deploy_olam_cluster.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@
382382
owner: true
383383
group: true
384384
private_key: '/home/{{ username }}/.ssh/{{ private_key }}'
385+
ssh_args: "-l {{ username }}"
385386
delegate_to: "{{ groups['control'][0] }}"
386387

387388
- name: Configure receptor
@@ -433,6 +434,8 @@
433434

434435
- name: Provision awx
435436
hosts: control[0]
437+
vars_files:
438+
- default_vars.yml
436439
become: true
437440

438441
tasks:
@@ -496,6 +499,8 @@
496499

497500
- name: Configure peers
498501
hosts: control,execution
502+
vars_files:
503+
- default_vars.yml
499504
become: true
500505

501506
tasks:

olam/passwordless_setup.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
- name: Generate ssh keypair for user
88
community.crypto.openssh_keypair:
9-
path: ~/.ssh/id_rsa
9+
path: "~/.ssh/{{ private_key }}"
1010
size: 2048
1111
comment: ol ssh keypair
1212
become: true
1313
become_user: "{{ username }}"
1414

1515
- name: Fetch public key file from server
1616
ansible.builtin.fetch:
17-
src: "~/.ssh/id_rsa.pub"
18-
dest: "buffer/{{ inventory_hostname }}-id_rsa.pub"
17+
src: "~/.ssh/{{ private_key }}.pub"
18+
dest: "buffer/{{ inventory_hostname }}-{{ private_key }}.pub"
1919
flat: true
2020
become: true
2121
become_user: "{{ username }}"
@@ -24,7 +24,7 @@
2424
ansible.posix.authorized_key:
2525
user: "{{ username }}"
2626
state: present
27-
key: "{{ lookup('file', 'buffer/{{ item }}-id_rsa.pub') }}"
27+
key: "{{ lookup('file', 'buffer/{{ item }}-{{ private_key }}.pub') }}"
2828
loop: "{{ groups['all'] | flatten(levels=1) }}"
2929
become: true
3030

0 commit comments

Comments
 (0)