Merging CI integration into Main branch #2
87
.drone.yml
Normal file
87
.drone.yml
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: run_ansible_tests_fedora39
|
||||||
|
|
||||||
|
global-variables:
|
||||||
|
ansible_image : &ansible_image "gitea.thezengarden.net/podman/images/ansible-dev:latest"
|
||||||
|
ansible_inventory : &ansible_inventory "-i 127.0.0.1, --connection=local"
|
||||||
|
ansible_playbook : &ansible_playbook "gitea.yml"
|
||||||
|
|
||||||
|
environment:
|
||||||
|
ANSIBLE_INVENTORY : *ansible_inventory
|
||||||
|
ANSIBLE_PLAYBOOK : *ansible_playbook
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
exclude:
|
||||||
|
- main
|
||||||
|
event: [push]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "ansible_environment_verify"
|
||||||
|
image: *ansible_image
|
||||||
|
commands:
|
||||||
|
- git log -1
|
||||||
|
- ansible --version
|
||||||
|
- ansible-lint --version
|
||||||
|
|
||||||
|
- name: "ansible_galaxy_requirements"
|
||||||
|
image: *ansible_image
|
||||||
|
commands:
|
||||||
|
- ansible-galaxy install -r requirements.yml
|
||||||
|
|
||||||
|
- name: "ansible_lint"
|
||||||
|
image: *ansible_image
|
||||||
|
commands:
|
||||||
|
- ansible-lint --offline
|
||||||
|
|
||||||
|
- name: "ansible_playbook_execution"
|
||||||
|
image: *ansible_image
|
||||||
|
commands:
|
||||||
|
- ansible-playbook -v $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: run_ansible_tests_centos9
|
||||||
|
|
||||||
|
global-variables:
|
||||||
|
ansible_image : &ansible_image "gitea.thezengarden.net/podman/images/ansible-dev:centos-stream9"
|
||||||
|
ansible_inventory : &ansible_inventory "-i 127.0.0.1, --connection=local"
|
||||||
|
ansible_playbook : &ansible_playbook "gitea.yml"
|
||||||
|
|
||||||
|
environment:
|
||||||
|
ANSIBLE_INVENTORY : *ansible_inventory
|
||||||
|
ANSIBLE_PLAYBOOK : *ansible_playbook
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
exclude:
|
||||||
|
- main
|
||||||
|
event: [push]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "ansible_environment_verify"
|
||||||
|
image: *ansible_image
|
||||||
|
commands:
|
||||||
|
- git log -1
|
||||||
|
- ansible --version
|
||||||
|
- ansible-lint --version
|
||||||
|
|
||||||
|
- name: "ansible_galaxy_requirements"
|
||||||
|
image: *ansible_image
|
||||||
|
commands:
|
||||||
|
- ansible-galaxy install -r requirements.yml
|
||||||
|
|
||||||
|
- name: "ansible_lint"
|
||||||
|
image: *ansible_image
|
||||||
|
commands:
|
||||||
|
- ansible-lint --offline
|
||||||
|
|
||||||
|
- name: "ansible_playbook_execution"
|
||||||
|
image: *ansible_image
|
||||||
|
commands:
|
||||||
|
- ansible-playbook -v $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
facts.d/
|
facts.d/
|
||||||
hosts
|
hosts
|
||||||
collections/
|
collections/
|
||||||
|
.vscode
|
13
ansible.cfg
13
ansible.cfg
@ -2,13 +2,12 @@
|
|||||||
inventory = hosts
|
inventory = hosts
|
||||||
roles_path = roles
|
roles_path = roles
|
||||||
collections_path = collections
|
collections_path = collections
|
||||||
#remote_tmp = /tmp/.ansible-${USER}/tmp
|
gathering = smart
|
||||||
#gathering = smart
|
gather_timeout = 300
|
||||||
#gather_timeout = 300
|
fact_path = facts.d
|
||||||
#fact_path = facts.d
|
fact_caching = jsonfile
|
||||||
#fact_caching = jsonfile
|
fact_caching_connection = facts.d
|
||||||
#fact_caching_connection = facts.d
|
fact_caching_timeout = 300
|
||||||
#fact_caching_timeout = 300
|
|
||||||
retry_files_enabled = False
|
retry_files_enabled = False
|
||||||
forks = 40
|
forks = 40
|
||||||
timeout = 30
|
timeout = 30
|
||||||
|
42
gitea.yml
42
gitea.yml
@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: Deploy Gitea
|
- name: Deploy Gitea
|
||||||
hosts: gitea
|
hosts: all
|
||||||
become: true
|
become: true
|
||||||
gather_facts: false
|
gather_facts: true
|
||||||
|
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
@ -73,25 +73,27 @@
|
|||||||
- /etc/gitea
|
- /etc/gitea
|
||||||
|
|
||||||
|
|
||||||
- name: Deploy unit file for Gitea
|
- name: Manage Gitea service
|
||||||
ansible.builtin.template:
|
when:
|
||||||
src : templates/gitea.service.j2
|
- ansible_virtualization_type | select('match', '(?:podman|docker|container)')
|
||||||
dest : /etc/systemd/system/gitea.service
|
block:
|
||||||
owner : root
|
- name: Deploy unit file for Gitea
|
||||||
group : root
|
ansible.builtin.template:
|
||||||
mode : "0644"
|
src : templates/gitea.service.j2
|
||||||
|
dest : /etc/systemd/system/gitea.service
|
||||||
|
owner : root
|
||||||
|
group : root
|
||||||
|
mode : "0644"
|
||||||
|
|
||||||
|
- name: Reload Systemd
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
daemon_reload: true
|
||||||
|
|
||||||
- name: Reload Systemd
|
- name: Start Gitea
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.service:
|
||||||
daemon_reload: true
|
name : gitea
|
||||||
|
state : started
|
||||||
|
enabled : true
|
||||||
- name: Start Gitea
|
|
||||||
ansible.builtin.service:
|
|
||||||
name : gitea
|
|
||||||
state : started
|
|
||||||
enabled : true
|
|
||||||
|
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
@ -99,6 +101,8 @@
|
|||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name : gitea
|
name : gitea
|
||||||
state : restarted
|
state : restarted
|
||||||
|
when:
|
||||||
|
- ansible_virtualization_type | select('match', '(?:podman|docker|container)')
|
||||||
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user