removed unnecessary local_action's

This commit is contained in:
Ruben Jongejan 2017-05-11 21:15:03 +02:00 committed by Ruben Jongejan
parent 50a961c6d2
commit 0c150cef4b
3 changed files with 14 additions and 10 deletions

View file

@ -1,16 +1,23 @@
---
- name: Generate the SSH private key
local_action: shell echo -e 'n' | ssh-keygen -b 2048 -C {{ SSH_keys.comment }} -t rsa -f {{ SSH_keys.private }} -q -N ""
shell: >
echo -e 'n' |
ssh-keygen -b 2048 -C {{ SSH_keys.comment }}
-t rsa -f {{ SSH_keys.private }} -q -N ""
args:
creates: "{{ SSH_keys.private }}"
- name: Generate the SSH public key
local_action: shell echo `ssh-keygen -y -f {{ SSH_keys.private }}` {{ SSH_keys.comment }} > {{ SSH_keys.public }}
shell: >
echo `ssh-keygen -y -f {{ SSH_keys.private }}` {{ SSH_keys.comment }}
> {{ SSH_keys.public }}
changed_when: false
- name: Change mode for the SSH private key
local_action: file path={{ SSH_keys.private }} mode=0600
file:
path: "{{ SSH_keys.private }}"
mode: 0600
- name: Ensure the dynamic inventory exists
blockinfile:

View file

@ -1,14 +1,12 @@
---
- name: Ensure the local ssh directory is exist
local_action:
module: file
path: "~/.ssh/"
file:
path: ~/.ssh/
state: directory
- name: Copy the algo ssh key to the local ssh directory
local_action:
module: copy
copy:
src: "{{ SSH_keys.private }}"
dest: ~/.ssh/algo.pem
mode: '0600'

View file

@ -1,8 +1,7 @@
---
- name: Wait until SSH becomes ready...
local_action:
module: wait_for
wait_for:
port: 22
host: "{{ cloud_instance_ip }}"
search_regex: "OpenSSH"