Sposto la creazione della chiave all'inizio del task di setup.
This commit is contained in:
parent
2048720f0c
commit
53c07dd366
@ -12,5 +12,3 @@
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- include: mgmtuser.yml
|
||||
|
||||
- include: ssh-keygen.yml
|
||||
|
@ -1,5 +1,8 @@
|
||||
---
|
||||
|
||||
- include: ssh-keygen.yml
|
||||
tags: ssh
|
||||
|
||||
- include: centos_pkgs.yml
|
||||
when: ansible_distribution == "CentOS" and ansible_os_family == "RedHat"
|
||||
tags: centos
|
||||
|
@ -1,22 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Verifica presenza directory .ssh
|
||||
shell: test -d /root/.ssh
|
||||
shell: test -d $HOME/.ssh
|
||||
register: check_sshdir
|
||||
ignore_errors: true
|
||||
|
||||
- name: Creazione directory .ssh
|
||||
shell: mkdir -p /root/.ssh
|
||||
shell: mkdir -p $HOME/.ssh
|
||||
when: check_sshdir|failed
|
||||
|
||||
- name: Verifica chiave ssh
|
||||
shell: test -f /root/.ssh/id_rsa
|
||||
shell: test -f $HOME/.ssh/id_rsa
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
register: check_key
|
||||
|
||||
- name: Gestione creazione chiave ssh
|
||||
shell: ssh-keygen -t rsa -b 1024 -f /root/.ssh/id_rsa -N ''
|
||||
sudo: yes
|
||||
sudo_user: root
|
||||
shell: ssh-keygen -t rsa -b 1024 -f $HOME/.ssh/id_rsa -N ''
|
||||
when: check_key|failed
|
Loading…
x
Reference in New Issue
Block a user