win_ansible_role_sshd/tasks/other_user_pubkeys.yml

31 lines
960 B
YAML
Raw Permalink Normal View History

2022-12-29 18:01:10 +01:00
---
- name: Create .ansible folder
ansible.windows.win_powershell:
script: "[System.IO.Directory]::CreateDirectory('{{ item }}')"
changed_when: _fw.changed
become: true
2023-09-17 14:32:37 +02:00
become_method: ansible.builtin.runas
2022-12-29 18:01:10 +01:00
become_user: "{{ win_sshd_otheruser }}"
vars:
ansible_become_pass: '{{ win_sshd_otherusepassword }}'
with_items:
- 'C:\Users\{{ win_sshd_otheruser }}\.ansible'
- name: Create .ansible folder
ansible.windows.win_powershell:
script: "attrib +h {{ item }}"
changed_when: _fw.changed
become: true
2023-09-17 14:32:37 +02:00
become_method: ansible.builtin.runas
2022-12-29 18:01:10 +01:00
become_user: "{{ win_sshd_otheruser }}"
vars:
ansible_become_pass: '{{ win_sshd_otherusepassword }}'
with_items:
- 'C:\Users\{{ win_sshd_otheruser }}\.ansible'
- name: Prepare Pubkey PS1 Script
ansible.windows.win_template:
src: 'templates/ssh_userkeys.ps1'
dest: 'C:\Users\{{ win_sshd_otheruser }}\.ansible\ssh_userkeys.ps1'
notify: 'Install SSH User Keys'