You can't have two actions in one task

This commit is contained in:
iRaven 2024-04-28 19:47:45 -05:00
parent 6b26cadb11
commit 382e3040c0

View File

@ -18,10 +18,11 @@
# Ansible user SSH pub key # Ansible user SSH pub key
# This is a really stupid way to do it, but alas. # This is a really stupid way to do it, but alas.
# This uses an environment variable named ansiblesvc_key in Semaphore which has the ssh-rsa pubkey. # This uses an environment variable named ansiblesvc_key in Semaphore which has the ssh-rsa pubkey.
- name: Add deployment user's SSH key. - name: Create deployment user .ssh directory.
file: file:
path: /home/ansible/.ssh path: /home/ansible/.ssh
state: directory state: directory
- name: Add deployment user's SSH key.
shell: shell:
cmd: echo "{{ ansiblesvc_key }}" > /home/ansible/.ssh/authorized_keys cmd: echo "{{ ansiblesvc_key }}" > /home/ansible/.ssh/authorized_keys
creates: /home/ansible/.ssh/authorized_keys creates: /home/ansible/.ssh/authorized_keys