Skip to content

Commit

Permalink
Refactor service configuration tasks and vardefs
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak committed Jun 15, 2024
1 parent b8afcad commit a22097a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/workflows/libvirt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
libvirt:
name: libvirt
runs-on: libvirt
needs: version
strategy:
matrix:
scenario:
Expand Down
8 changes: 3 additions & 5 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ docker_rpm_repo:
docker_repo_state: present
docker_repo_manage: "{{ docker_packages_state != 'absent' }}"

docker_packages_state: present
docker_packages:
- docker-ce
- docker-ce-cli

docker_packages_state: present
docker_configuration_template: mountflags.conf.j2
docker_configuration_file: /etc/systemd/system/docker.service.d/mountflags.conf
docker_configuration_path: "{{ docker_configuration_file | dirname }}"
docker_service_confdir: /etc/systemd/system/docker.service.d
docker_service_name: docker
docker_service_state: started
docker_service_enabled: true
Expand All @@ -33,4 +31,4 @@ docker_conf:
log-opts:
max-size: "10m"
max-file: '3'
registry-mirrors: "{{ docker_conf_mirrors }}"
registry-mirrors: "{{ docker_conf_mirrors }}" # see https://docs.docker.com/docker-hub/mirror/#configure-the-docker-daemon
14 changes: 8 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@
- name: Configure service
when: docker_packages_state != 'absent'
block:

- name: Configure service path
ansible.builtin.file:
path: "{{ docker_configuration_path }}"
path: "{{ docker_service_confdir }}"
state: directory
group: root
owner: root
Expand All @@ -62,20 +61,23 @@
when: docker_service_manage
tags: install
block:

- name: Configure service
ansible.builtin.template:
src: "{{ docker_configuration_template }}"
dest: "{{ docker_configuration_file }}"
ansible.builtin.copy:
dest: "{{ docker_service_confdir }}/mountflags.conf"
content: |
[Service]
MountFlags=shared
group: root
owner: root
mode: 'u=rw,go=r'

- name: Include service tasks
ansible.builtin.include_tasks: service.yml


- name: Include configuration tasks
ansible.builtin.include_tasks: config.yml


- name: Include user tasks
ansible.builtin.include_tasks: users.yml
2 changes: 0 additions & 2 deletions templates/mountflags.conf.j2

This file was deleted.

0 comments on commit a22097a

Please sign in to comment.