Michele Naldini
2019-08-20 04d6c1c8cef14e1d05e269181bc2a53cbf8fc282
use openssh_keypair, fixing typo, merge with upstream redhat-cop (#609)

* add become: true to workload.yml for some tasks

add become: true to :
- Generate a brand new SSH key on MASTER that will be used also by APB container (provision.yml)
- add new ssh-key as authorized on BASTION host

* use openssh_keypair to generate ssh key instead of shell

* fixing typo
1 files modified
9 ■■■■ changed files
ansible/roles/ocp-workload-edge-deployments/tasks/workload.yml 9 ●●●● patch | view | raw | blame | history
ansible/roles/ocp-workload-edge-deployments/tasks/workload.yml
@@ -10,11 +10,18 @@
    path: /opt/apb/id_rsa
    state: directory
    mode: '0755'
  become: true
- name: Generate a brand new SSH key on MASTER that will be used also by APB container (provision.yml)
  shell: "ssh-keygen -N '' -f /opt/apb/id_rsa"
  openssh_keypair:
    path: /opt/apb/id_ssh_rsa
    force: yes
  become: true
#- name: Generate a brand new SSH key on MASTER that will be used also by APB container (provision.yml)
#  shell: "ssh-keygen -N '' -f /opt/apb/id_rsa"
#  become: true
- name: add new ssh-key as authorized on BASTION host
  shell: "cat /opt/apb/id_rsa | ssh -i /root/.ssh/milan-fa8ckey.pem ec2-user@bastion 'cat >> .ssh/authorized_keys'"
  become: true