From d23c952a4e67d247799e2a56bf44ab71735dba83 Mon Sep 17 00:00:00 2001 From: Jack Ivanov Date: Sat, 14 Jan 2017 19:37:47 +0300 Subject: [PATCH] Add the algo ssh key to any server (prevent fails when a user wants to update-users on a server deployed by algo but not with the algo ssh key) --- deploy.yml | 2 +- playbooks/common.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy.yml b/deploy.yml index 649481e..7b7e9ef 100644 --- a/deploy.yml +++ b/deploy.yml @@ -7,7 +7,7 @@ pre_tasks: - name: Local pre-tasks include: playbooks/local.yml - tags: [ 'cloud' ] + tags: [ 'always' ] roles: - { role: cloud-digitalocean, tags: ['digitalocean'] } diff --git a/playbooks/common.yml b/playbooks/common.yml index 36a051c..c195b13 100644 --- a/playbooks/common.yml +++ b/playbooks/common.yml @@ -5,3 +5,10 @@ raw: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 tags: - update-alternatives + +- name: Ensure the algo ssh key exist on the server + authorized_key: + user: "{{ ansible_ssh_user }}" + state: present + key: "{{ lookup('file', '{{ SSH_keys.public }}') }}" + tags: [ 'always' ]