Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/roles/_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ bin_directory: "/home/{{ deploy_user }}/.bin"
# Number of dumps/db to look up for cleanup.
cleanup_history_depth: 50
install_php_cachetool: true # set to false if you don't need cachetool, e.g. for a nodejs app
ce_deploy_version: 1.x
lock_file: /tmp/ce-deploy-lock
provision_lock_file: /tmp/ce-provision-lock # must match _init.lock_file in ce-provision
# AWS ASG variables to allow for the suspension of autoscaling during a code deployment.
aws_asg:
name: "" # if the deploy is on an ASG put the name here
Expand Down
2 changes: 2 additions & 0 deletions docs/roles/database_backup/database_backup-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ mysql_backup:
mysqldump_params: "{{ _mysqldump_params }}" # set in _init but you can override here
# Location on deploy server where the generated MySQL password will be stashed - should be temporary storage
mysql_password_path: "/tmp/.ce-deploy/{{ project_name }}_{{ build_type }}_{{ build_number }}"
# Uncomment to login with MySQL socket instead of TCP/IP (e.g. for MariaDB after secure set-up)
#mysql_unix_socket: /run/mysqld/mysqld.sock
# Number of dumps/db to keep. Note this is independant from the build codebases.
keep: 10
# This can be one of the following:
Expand Down
5 changes: 5 additions & 0 deletions roles/_exit/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
when:
- aws_asg.name is defined
- aws_asg.name | length > 0

- name: Delete the lock file.
ansible.builtin.file:
path: "{{ lock_file }}"
state: absent
3 changes: 3 additions & 0 deletions roles/_init/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ bin_directory: "/home/{{ deploy_user }}/.bin"
# Number of dumps/db to look up for cleanup.
cleanup_history_depth: 50
install_php_cachetool: true # set to false if you don't need cachetool, e.g. for a nodejs app
ce_deploy_version: 1.x
lock_file: /tmp/ce-deploy-lock
provision_lock_file: /tmp/ce-provision-lock # must match _init.lock_file in ce-provision
# AWS ASG variables to allow for the suspension of autoscaling during a code deployment.
aws_asg:
name: "" # if the deploy is on an ASG put the name here
Expand Down
3 changes: 3 additions & 0 deletions roles/_init/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ bin_directory: "/home/{{ deploy_user }}/.bin"
# Number of dumps/db to look up for cleanup.
cleanup_history_depth: 50
install_php_cachetool: true # set to false if you don't need cachetool, e.g. for a nodejs app
ce_deploy_version: 1.x
lock_file: /tmp/ce-deploy-lock
provision_lock_file: /tmp/ce-provision-lock # must match _init.lock_file in ce-provision
# AWS ASG variables to allow for the suspension of autoscaling during a code deployment.
aws_asg:
name: "" # if the deploy is on an ASG put the name here
Expand Down
31 changes: 31 additions & 0 deletions roles/_init/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
---
- name: Version check.
ansible.builtin.debug:
msg: "Using ce-deploy {{ ce_deploy_version }}"

- name: Check for a ce-provision lock file.
ansible.builtin.stat:
path: "{{ provision_lock_file }}"
register: _ce_provision_lock

- name: Abort if ce-provision lock file exists.
when: _ce_provision_lock.stat.exists is defined and _ce_provision_lock.stat.exists
block:
- name: Abort if ce-provision lock file is found.
ansible.builtin.debug:
msg: "ce-provision lock file discovered, an infrastructure build is in progress! If this is not the case, login to the affected server and delete the file at {{ provision_lock_file }}."
- ansible.builtin.meta: end_play

- name: Check OS family.
when: ansible_os_family == "Windows"
block:
- name: Abort if target is a Windows server.
ansible.builtin.debug:
msg: "ce-deploy currently only supports Linux like operating systems, and works best with Debian Linux."
- ansible.builtin.meta: end_play

- name: Set a lock file.
ansible.builtin.file:
path: "{{ lock_file }}"
state: touch
mode: 0644

# Ensure default values for common variables.
- name: Define deploy user.
ansible.builtin.set_fact:
Expand Down
2 changes: 2 additions & 0 deletions roles/database_backup/database_backup-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ mysql_backup:
mysqldump_params: "{{ _mysqldump_params }}" # set in _init but you can override here
# Location on deploy server where the generated MySQL password will be stashed - should be temporary storage
mysql_password_path: "/tmp/.ce-deploy/{{ project_name }}_{{ build_type }}_{{ build_number }}"
# Uncomment to login with MySQL socket instead of TCP/IP (e.g. for MariaDB after secure set-up)
#mysql_unix_socket: /run/mysqld/mysqld.sock
# Number of dumps/db to keep. Note this is independant from the build codebases.
keep: 10
# This can be one of the following:
Expand Down