-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from arillso/fix/docker-compose
fix: docker-compose
- Loading branch information
Showing
7 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
namespace: arillso | ||
name: container | ||
version: 0.0.0 | ||
version: 0.0.4 | ||
readme: README.md | ||
|
||
authors: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
--- | ||
- name: Install Docker Compose packages | ||
become: true | ||
ansible.builtin.package: | ||
name: "{{ item }}" | ||
state: present | ||
loop: "{{ docker_compose_packages }}" | ||
# https://github.com/ansible-collections/community.docker/pull/586 | ||
# - name: Install Docker Compose packages | ||
# become: true | ||
# ansible.builtin.package: | ||
# name: "{{ item }}" | ||
# state: present | ||
# loop: "{{ docker_compose_packages }}" | ||
|
||
- name: Installiere docker-compose wo pip | ||
ansible.builtin.pip: | ||
name: docker-compose | ||
extra_args: --break-system-packages | ||
|
||
- name: Ensure Docker Compose directory exists with correct permissions | ||
become: true | ||
ansible.builtin.file: | ||
path: "{{ docker_compose_yaml_dir }}" | ||
path: "{{ docker_compose_directory }}" | ||
state: directory | ||
mode: "0755" | ||
|
||
|
@@ -19,6 +26,7 @@ | |
when: docker_compose_use_file | ||
block: | ||
- name: Set up Docker Compose systemd service on target host | ||
become: true | ||
ansible.builtin.template: | ||
src: etc/systemd/system/[email protected] | ||
dest: /etc/systemd/system/[email protected] | ||
|
@@ -27,6 +35,7 @@ | |
mode: "0644" | ||
|
||
- name: Create Docker Compose configuration file from template | ||
become: true | ||
ansible.builtin.template: | ||
src: etc/docker/compose/docker-compose.yml.j2 | ||
dest: "{{ docker_compose_directory_path }}/{{ docker_compose_project }}/docker-compose.yml" | ||
|
@@ -35,6 +44,7 @@ | |
mode: "0644" | ||
|
||
- name: Launch Docker Compose based on specified configuration | ||
become: true | ||
community.docker.docker_compose: | ||
project_src: "{{ docker_compose_directory if docker_compose_use_file else omit }}" | ||
definition: "{{ docker_compose_config if not docker_compose_use_file else omit }}" | ||
|
2 changes: 1 addition & 1 deletion
2
roles/docker_compose/templates/etc/docker/compose/docker-compose.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{{ docker_compose_config }} | ||
{{ docker_compose_config | to_nice_yaml }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters