2018-09-29 17:19:18 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- hosts: "all"
|
|
|
|
become: True
|
|
|
|
|
|
|
|
vars:
|
|
|
|
acme_sh_become_user: "test"
|
|
|
|
roles:
|
|
|
|
- "role_under_test"
|
|
|
|
|
|
|
|
pre_tasks:
|
|
|
|
- name: Add test user
|
|
|
|
user:
|
|
|
|
name: "{{ acme_sh_become_user }}"
|
|
|
|
shell: "/bin/bash"
|
|
|
|
|
|
|
|
post_tasks:
|
2018-09-30 01:06:30 +02:00
|
|
|
- name: Ensure acme.sh was cloned
|
2018-09-29 17:19:18 +02:00
|
|
|
command: test -d /usr/local/src/acme.sh
|
|
|
|
register: result_cloned
|
|
|
|
changed_when: result_cloned.rc != 0
|
|
|
|
|
2018-09-30 01:06:30 +02:00
|
|
|
- name: Ensure acme.sh was installed
|
2018-09-29 17:19:18 +02:00
|
|
|
command: ./acme.sh --version
|
|
|
|
args:
|
|
|
|
chdir: "~/.acme.sh"
|
|
|
|
register: result_installed
|
|
|
|
changed_when: result_installed.rc != 0
|
|
|
|
become_user: "{{ acme_sh_become_user }}"
|
|
|
|
|
|
|
|
- name: Ensure certificate installation path exists
|
|
|
|
command: test -d /etc/ssl/ansible
|
|
|
|
register: result_cert_installed_path
|
|
|
|
changed_when: result_cert_installed_path.rc != 0
|