Skip to content

Commit

Permalink
Merge pull request #45 from sourcecode-glitch/docker-compose-cli-plugin
Browse files Browse the repository at this point in the history
Use docker compose cli plugin
  • Loading branch information
ntimo authored Dec 21, 2023
2 parents 1d9fa29 + e03d1ed commit cdc38d7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ This role will use by default the `inventory_hostname` as mailcow hostname, this
| `mailcow__redirect_http_to_https` | if `yes`, all requests via HTTP will be redirected to HTTPS | `no` | also see https://mailcow.github.io/mailcow-dockerized-docs/u_e-80_to_443/ |
| `mailcow__config_acme_contact` | sets ACME_CONTACT in mailcow.conf | | |
| `mailcow__rspamd_clamd_servers` | configures the clamd server used by rspamd | `clamd:3310` | |
| `mailcow__compose_command` | configures the command that is used for compose | `docker compose` | set to `docker-compose` for the standalone version of compose |

## Usage

Expand Down
3 changes: 3 additions & 0 deletions defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ mailcow__install_updates: yes
mailcow__redirect_http_to_https: no

mailcow__rspamd_clamd_servers: clamd:3310

# Change this to "docker-compose" if you use the standalone version of compose
mailcow__compose_command: docker compose
8 changes: 4 additions & 4 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
- name: Restart mailcow

Check failure on line 3 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.
become: yes
shell: |
docker-compose --project-name {{ mailcow__docker_compose_project_name }} restart
{{ mailcow__compose_command }} --project-name {{ mailcow__docker_compose_project_name }} restart
args:
chdir: "{{ mailcow__install_path }}"

- name: Recreate mailcow

Check failure on line 10 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.
become: yes
shell: |
docker-compose --project-name {{ mailcow__docker_compose_project_name }} down
docker-compose --project-name {{ mailcow__docker_compose_project_name }} up -d
{{ mailcow__compose_command }} --project-name {{ mailcow__docker_compose_project_name }} down
{{ mailcow__compose_command }} --project-name {{ mailcow__docker_compose_project_name }} up -d
args:
chdir: "{{ mailcow__install_path }}"

- name: Restart mailcow rspamd

Check failure on line 18 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.
become: yes
shell: |
docker-compose --project-name {{ mailcow__docker_compose_project_name }} restart rspamd-mailcow
{{ mailcow__compose_command }} --project-name {{ mailcow__docker_compose_project_name }} restart rspamd-mailcow
args:
chdir: "{{ mailcow__install_path }}"
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
- name: Start mailcow container stack

Check failure on line 59 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.
become: yes
shell: |
docker-compose --project-name {{ mailcow__docker_compose_project_name }} up -d
{{ mailcow__compose_command }} --project-name {{ mailcow__docker_compose_project_name }} up -d
args:
chdir: "{{ mailcow__install_path }}"
when: not mailcow_running.exists
Expand Down

0 comments on commit cdc38d7

Please sign in to comment.