chore: ansible-lint

This commit is contained in:
Clément Désiles
2025-11-02 21:18:15 +01:00
parent 2c6da106b2
commit 2c421611ae
53 changed files with 390 additions and 350 deletions
+19 -19
View File
@@ -5,49 +5,49 @@
# Archlinux: only if your target is meant to frequently build docker images
# see: https://stackoverflow.com/a/78352698
- name: uninstall docker
block:
- name: Include uninstall tasks
include_tasks: uninstall.yml
- name: Skip docker installation
meta: end_play
- name: Uninstall docker
when: uninstall_docker | lower in ['yes', 'y']
- name: install docker
package:
block:
- name: Include uninstall tasks
ansible.builtin.include_tasks: uninstall.yml
- name: Skip docker installation
ansible.builtin.meta: end_play
- name: Install docker
ansible.builtin.package:
name: docker
- name: enable the service
service:
- name: Enable the service
ansible.builtin.service:
name: "docker"
enabled: true
state: started
- command:
- ansible.builtin.command:
cmd: whoami
no_log: true
become: false
register: main_user
- set_fact:
- ansible.builtin.set_fact:
main_user: "{{ main_user.stdout }}"
no_log: true
- name: create projects directory
file:
- name: Create projects directory
ansible.builtin.file:
path: "{{ docker_projects_dir }}"
state: directory
owner: "{{ main_user }}"
group: "{{ main_user }}"
- name: allow user to use docker
user:
- name: Allow user to use docker
ansible.builtin.user:
name: "{{ main_user }}"
groups: docker
append: yes
append: true
register: docker_group
- name: inform the user that user needs to logout and login again
debug:
- name: Inform the user that user needs to logout and login again
ansible.builtin.debug:
msg: "Please logout and login again to make sure the user is added to the docker group"
when: docker_group.changed
+6 -6
View File
@@ -1,17 +1,17 @@
---
- name: uninstall docker
package:
- name: Uninstall docker
ansible.builtin.package:
name: docker
state: absent
- name: prompt the user for confirmation
- name: Prompt the user for confirmation
ansible.builtin.pause:
prompt: "[IRREVERSIBLE] Are you sure you want to delete {{ docker_projects_dir }}?"
echo: yes
echo: true
register: confirmation
- name: remote projects directory
file:
- name: Remote projects directory
ansible.builtin.file:
path: "{{ docker_projects_dir }}"
state: absent
owner: "{{ main_user }}"