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

Merge pull request #26 from roles-ansible/lint

update ansible-linting
This commit is contained in:
L3D 2022-10-25 22:53:12 +02:00 committed by GitHub
commit 25907677aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 28 deletions

View file

@ -4,13 +4,14 @@ galaxy_info:
author: do1jlr
description: Install acmetool, an easy-to-use command line tool for automatically acquiring certificates from ACME servers (eg. Let's Encrypt)
license: "MIT"
min_ansible_version: 2.11
github_branch: main
min_ansible_version: '2.11'
platforms:
- name: Debian
versions: all
versions:
- all
- name: Ubuntu
versions: all
versions:
- all
galaxy_tags:
- acmetool
- acmetool

View file

@ -11,7 +11,7 @@
- name: Copy acmetool response file
become: true
ansible.builtin.template:
src: "{{ lookup('first_found', acmetool__response_file ) }}"
src: "{{ lookup('first_found', acmetool__response_file) }}"
dest: '/var/lib/acme/conf/responses'
owner: root
group: root

View file

@ -2,13 +2,13 @@
- name: Copy hook to enable acmetool to reload services
become: true
ansible.builtin.copy:
src: "{{ lookup('first_found', acmetool__reload_hook ) }}"
src: "{{ lookup('first_found', acmetool__reload_hook) }}"
dest: '/etc/acme/hooks/'
owner: root
group: root
mode: 'u=rx,g=rx,o=rx'
- name: create hook configuration to reload services via ansible
- name: Create hook configuration to reload services via ansible
become: true
ansible.builtin.template:
src: 'templates/acmetool_reload.j2'
@ -20,13 +20,13 @@
- name: Copy hook to enable acmetool to restart services
become: true
ansible.builtin.copy:
src: "{{ lookup('first_found', acmetool__restart_hook ) }}"
src: "{{ lookup('first_found', acmetool__restart_hook) }}"
dest: '/etc/acme/hooks/'
owner: root
group: root
mode: 'u=rx,g=rx,o=rx'
- name: create hook configuration to restart services via ansible
- name: Create hook configuration to restart services via ansible
become: true
ansible.builtin.template:
src: 'templates/acmetool_restart.j2'

View file

@ -3,13 +3,13 @@
ansible.builtin.include_tasks: versioncheck.yml
when: submodules_versioncheck|bool
- name: install acmetool
- name: Install acmetool
ansible.builtin.include_tasks: install.yml
- name: configure systemd
- name: Configure systemd
ansible.builtin.include_tasks: systemd.yml
- name: configure acmetool
- name: Configure acmetool
ansible.builtin.include_tasks: configure.yml
- name: Copy hook to enable acmetool to restart services
@ -18,8 +18,8 @@
- name: Reload systemd and enable acmetool timer unit
ansible.builtin.include_tasks: timer.yml
- name: optionally want domains
- name: Optionally want domains
ansible.builtin.include_tasks: want_domains.yml
- name: optionally unwant domains
- name: Optionally unwant domains
ansible.builtin.include_tasks: unwant_domains.yml

View file

@ -1,5 +1,5 @@
---
- name: deploy systemd service file
- name: Deploy systemd service file
become: true
ansible.builtin.template:
src: 'templates/acmetool.service.j2'
@ -8,7 +8,7 @@
group: 'root'
mode: '0644'
- name: force systemd to reread configs and start acmetool
- name: Force systemd to reread configs and start acmetool
become: true
ansible.builtin.systemd:
daemon_reload: true

View file

@ -1,5 +1,5 @@
---
- name: disable acmetool for acme_domain_unwant_list domains
- name: Disable acmetool for acme_domain_unwant_list domains
become: true
ansible.builtin.command: "acmetool unwant {{ _domain.name }}"
with_items: "{{ acme_domain_unwant_list }}"

View file

@ -8,37 +8,38 @@
path: '/etc/.ansible-version'
state: directory
mode: 0755
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
- name: check playbook version
- name: Check playbook version
become: true
ansible.builtin.slurp:
src: "/etc/.ansible-version/{{ playbook_version_path }}"
register: playbook_version
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
ignore_errors: true
failed_when: false
- name: Print remote role version
ansible.builtin.debug:
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
- name: Print locale role version
ansible.builtin.debug:
msg: "Local role version: '{{ playbook_version_number|string }}'."
when: submodules_versioncheck|bool
msg: "Local role version: '{{ playbook_version_number | string }}'."
when: submodules_versioncheck | bool
- name: Check if your version is outdated
ansible.builtin.fail:
msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!"
when:
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck | bool
- name: write new version to remote disk
- name: Write new version to remote disk
become: true
ansible.builtin.copy:
content: "{{ playbook_version_number }}"
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
mode: '0644'
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
tags: skip_ansible_lint_template-instead-of-copy

View file

@ -1,5 +1,5 @@
---
- name: enable acmetool for acme_domain_list domains
- name: Enable acmetool for acme_domain_list domains
become: true
ansible.builtin.command: "acmetool want {{ _domain.name }}"
args:

View file

@ -33,5 +33,5 @@ acmetool__restart_hook:
- 'files'
# versionscheck
playbook_version_number: 33 # should be a integer
playbook_version_number: 34 # should be a integer
playbook_version_path: 'do1jlr.role-acmetool.version'