Last active
May 2, 2026 14:37
-
-
Save veerendra2/babdc2cb83e304fabfb5005c20454927 to your computer and use it in GitHub Desktop.
Ansible Playbook to Deploy ComposeFlux
This file contains hidden or 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
| --- | |
| # ************************************************* | |
| # ComposeFlux Secrets Vars | |
| # ************************************************* | |
| # | |
| # You can move below secrets a separate file and | |
| # use ansible-vault to encrypt the file | |
| # INFO: https://docs.ansible.com/projects/ansible/latest/vault_guide/index.html | |
| # | |
| composeflux_secret_vars: | |
| INFISICAL_CLIENT_SECRET: REDACTED | |
| INFISICAL_CLIENT_ID: REDACTED | |
| INFISICAL_PROJECT_ID: REDACTED | |
| INFISICAL_ENVIRONMENT: REDACTED | |
| --- | |
| # ************************************************* | |
| # ComposeFlux Env Vars | |
| # ************************************************* | |
| # | |
| composeflux_env_vars: | |
| COMPOSEFLUX_VERSION: "{{ composeflux_version | default('latest') }}" | |
| GIT_REPO_URL: "git@github.com:veerendra2/REDACTED.git" | |
| STACK_PATH: servers/helium | |
| GIT_CLONE_PATH: /opt/docker/compose-stack | |
| IMAGE_UPDATE_SCHEDULE: "0 4 * * 1" | |
| GIT_BRANCH: dev | |
| SECRETS_PROVIDER: infisical | |
| GIT_DEPLOY_KEY_SECRET_REF: SSH_PRIVATE_KEY | |
| LOG_LEVEL: info | |
| LOG_ADD_SOURCE: false | |
| INFISICAL_SECRET_PATH: /home-servers/helium | |
| METRICS_ADDR: "" | |
| --- | |
| - name: Deploy ComposeFlux | |
| hosts: all | |
| become: true | |
| tasks: | |
| - name: Ensure ComposeFlux directories exists | |
| ansible.builtin.file: | |
| state: directory | |
| path: "{{ item }}" | |
| owner: "{{ ansible_user }}" | |
| group: "{{ ansible_user }}" | |
| mode: "0755" | |
| loop: | |
| - "{{ composeflux_env_vars.GIT_CLONE_PATH }}" | |
| - /opt/docker/composeflux | |
| - /opt/docker/secrets | |
| - /opt/docker/volumes | |
| - name: Copy ComposeFlux compose.yml | |
| ansible.builtin.copy: | |
| src: files/docker-compose-files/composeflux.compose.yml | |
| dest: /opt/docker/composeflux/compose.yml | |
| owner: "{{ ansible_user }}" | |
| group: "{{ ansible_user }}" | |
| mode: "0644" | |
| - name: Deploy ComposeFlux | |
| community.docker.docker_compose_v2: | |
| project_src: /opt/docker/composeflux | |
| pull: always | |
| files: | |
| - compose.yml | |
| environment: "{{ composeflux_secret_vars | combine(composeflux_env_vars) }}" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created this ansible playbook snippet for my blog.