1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_acmetool.git synced 2024-08-16 12:29:49 +02:00
ansible_role_acmetool/tasks/main.yml

76 lines
1.6 KiB
YAML
Raw Normal View History

2019-07-27 17:11:01 +02:00
---
2021-03-20 17:59:44 +01:00
- ansible.builtin.include_tasks: versioncheck.yml
when: submodules_versioncheck|bool
2019-07-27 17:11:01 +02:00
- name: Install acmetool
2021-02-24 00:31:07 +01:00
ansible.builtin.package:
2019-07-27 17:11:01 +02:00
name: 'acmetool'
state: present
tags:
- installation
- acmetool
# Todo: Reconsider best practice
#- name: Remove acmetool snippet for nginx from package installation
2021-02-24 00:31:07 +01:00
# ansible.builtin.file:
# path: '/etc/nginx/snippets/acmetool.conf'
# state: absent
# tags:
# - installation
# - configuration
# - acmetool
2019-07-27 17:11:01 +02:00
- name: Create directory for acmetool response file
2021-02-24 00:31:07 +01:00
ansible.builtin.file:
2019-07-27 17:11:01 +02:00
name: '/var/lib/acme/conf'
state: directory
owner: root
group: root
mode: 'u=rwx,g=rx,o=rx'
tags:
- installation
- acmetool
2019-07-27 17:11:01 +02:00
- name: Copy acmetool response file
2021-02-24 00:31:07 +01:00
ansible.builtin.template:
2019-07-27 17:11:01 +02:00
src: 'files/response-file.yml.j2'
dest: '/var/lib/acme/conf/responses'
owner: root
group: root
mode: 'u=rw,g=r,o=r'
tags:
- configuration
- acmetool
2021-03-20 17:59:44 +01:00
# Todo: with_first_found?
2021-02-24 00:31:07 +01:00
# consider usage of loop:
2019-07-27 17:11:01 +02:00
- name: Perform acmetool quickstart
2021-02-24 00:31:07 +01:00
ansible.builtin.command: acmetool quickstart --expert
2019-07-27 17:11:01 +02:00
args:
creates: '/var/lib/acme/conf/target'
tags:
- configuration
- operation
- acmetool
2019-07-27 17:11:01 +02:00
- name: Copy hook to enable acmetool to restart services
2021-02-24 00:31:07 +01:00
ansible.builtin.copy:
2019-07-27 17:11:01 +02:00
src: 'files/restart'
dest: '/etc/acme/hooks/'
2019-07-27 17:11:01 +02:00
owner: root
group: root
mode: 'u=rx,g=rx,o=rx'
tags:
- configuration
- acmetool
2019-07-27 17:44:40 +02:00
- name: Reload systemd and enable acmetool timer unit
2021-02-24 00:31:07 +01:00
ansible.builtin.systemd:
2019-07-27 17:44:40 +02:00
name: 'acmetool.timer'
daemon_reload: yes
enabled: yes
state: started
tags:
- operation
- acmetool