Skip to content

Commit

Permalink
Use less common internal var name (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnmvisser authored Apr 16, 2023
1 parent 37c7323 commit 83af3ea
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tasks/ssh_keypairs.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
---
- name: "Ensure private key is available for {{ account.name }}"
copy:
content: "{{ key.private }}"
dest: "{{ current_user.home }}/.ssh/{{ key.dest }}"
content: "{{ _key.private }}"
dest: "{{ current_user.home }}/.ssh/{{ _key.dest }}"
owner: "{{ account.name }}"
group: "{{ current_primary_group }}"
mode: "{{ current_user.mode | default('0400') }}"
no_log: true
loop: "{{ account.ssh_keypairs }}"
loop_control:
loop_var: key
label: "{{ key.dest }}"
loop_var: _key
label: "{{ _key.dest }}"
when:
- current_user.home is defined
- key.private is defined
- key.private|length > 0
- _key.private is defined
- _key.private|length > 0

- name: "Ensure public key is available for user {{ account.name }}"
copy:
content: "{{ key.public }}"
dest: "{{ current_user.home }}/.ssh/{{ key.dest }}.pub"
content: "{{ _key.public }}"
dest: "{{ current_user.home }}/.ssh/{{ _key.dest }}.pub"
owner: "{{ account.name }}"
group: "{{ current_primary_group }}"
mode: "{{ current_user.mode | default('0644') }}"
loop: "{{ account.ssh_keypairs }}"
loop_control:
loop_var: key
label: "{{ key.dest }}"
loop_var: _key
label: "{{ _key.dest }}"
when:
- current_user.home is defined
- key.public is defined
- key.public|length > 0
- _key.public is defined
- _key.public|length > 0

0 comments on commit 83af3ea

Please sign in to comment.