feature ci/cd test 0.0046
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
- hosts: servers
|
||||
become: yes
|
||||
vars:
|
||||
env_file: .env
|
||||
tasks:
|
||||
- name: Install Docker
|
||||
shell: curl -fsSL https://get.docker.com | sh
|
||||
args:
|
||||
creates: /usr/bin/docker
|
||||
apt:
|
||||
name: docker-compose
|
||||
state: present
|
||||
update_cache: yes
|
||||
- name: Copy .env to remote
|
||||
copy:
|
||||
src: "{{ env_file }}"
|
||||
dest: /opt/infra/.env
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0600'
|
||||
|
||||
- name: Install git
|
||||
apt:
|
||||
@@ -14,10 +24,11 @@
|
||||
|
||||
- name: Clone repo
|
||||
git:
|
||||
repo: ${GITEA_INSTANCE_URL} //как то передавать переменные
|
||||
repo: "{{ gitea_instance_url }}"
|
||||
dest: /opt/infra
|
||||
|
||||
- name: Start docker compose
|
||||
shell: docker compose up -d
|
||||
args:
|
||||
chdir: /opt/infra
|
||||
- name: Start docker compose via module
|
||||
community.docker.docker_compose:
|
||||
project_src: /opt/infra
|
||||
state: present
|
||||
restarted: true
|
||||
@@ -1,3 +0,0 @@
|
||||
ansible-playbook -i inventory.ini deploy.yml -e "target_host=$HOST"
|
||||
GITEA_INSTANCE_URL="..."
|
||||
HOST="..."
|
||||
@@ -1,2 +0,0 @@
|
||||
[servers]
|
||||
myserver ansible_user=root
|
||||
2
ansible/inventory_example
Normal file
2
ansible/inventory_example
Normal file
@@ -0,0 +1,2 @@
|
||||
[servers]
|
||||
myserver host=... ansible_user=...
|
||||
1
ansible/secrets_example
Normal file
1
ansible/secrets_example
Normal file
@@ -0,0 +1 @@
|
||||
gitea_instance_url: ...
|
||||
Reference in New Issue
Block a user