Skip to content
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
8 changes: 5 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ jobs:
run: actionlint -ignore 'label "CI-CD" is unknown' .github/workflows/CI.yml

- name: Run codespell
run: codespell --enable-colors
run: codespell --enable-colors -L chage

- name: Run mdl
run: mdl --style .github/workflows/mdl_style.rb .

- name: Run ansible-lint
run: ansible-lint -q --force-color --config-file .github/workflows/ansible-lint.conf --project-dir Ansible/playbooks/
run: ansible-lint -q --force-color
working-directory: Ansible

- name: Run ansible-inventory
run: error=$( { ansible-inventory --list --yaml -i Ansible/inventories/ > /dev/null; } 2>&1 ); [ -n "${error}" ] && echo "${error}" && exit 1 || exit 0
run: error=$( { ansible-inventory --list --yaml > /dev/null; } 2>&1 ); [ -n "${error}" ] && echo "${error}" && exit 1 || exit 0
working-directory: Ansible
File renamed without changes.
141 changes: 22 additions & 119 deletions Ansible/Jenkins_Pipeline_Update_Infra.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,221 +2,124 @@ pipeline {
agent any

stages {
stage('Update Docker Containers - VMs - Dev') {
stage('Update Podman Containers) {
steps {
script {
def result = build(
job: 'Update_Docker_Containers',
job: 'Update_Podman_Containers',
parameters: [
string(name: 'SERVER_TYPE', value: 'VMs'),
string(name: 'ENV', value: 'dev'),
string(name: 'SERVERS', value: 'all'),
string(name: 'SERVERS', value: 'podman'),
string(name: 'DANGLING', value: 'true')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Docker Containers - VMs - Dev failed. Aborting pipeline.")
error("Update Podman Containers failed. Aborting pipeline.")
}
}
}
}

stage('Update Docker Containers - VMs - Prod') {
steps {
script {
def result = build(
job: 'Update_Docker_Containers',
parameters: [
string(name: 'SERVER_TYPE', value: 'VMs'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'all'),
string(name: 'DANGLING', value: 'true')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Docker Containers - VMs - Prod failed. Aborting pipeline.")
}
}
}
}

stage('Update Docker Containers - VPS - Prod') {
steps {
script {
def result = build(
job: 'Update_Docker_Containers',
parameters: [
string(name: 'SERVER_TYPE', value: 'VPS'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'all'),
string(name: 'DANGLING', value: 'true')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Docker Containers - VPS - Prod failed. Aborting pipeline.")
}
}
}
}

stage('Update Docker Containers - Proxmox - Prod') {
steps {
script {
def result = build(
job: 'Update_Docker_Containers',
parameters: [
string(name: 'SERVER_TYPE', value: 'Proxmox'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'all'),
string(name: 'DANGLING', value: 'true')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Docker Containers - Proxmox - Prod failed. Aborting pipeline.")
}
}
}
}

stage('Update Servers - VMs - Dev - All') {
steps {
script {
def result = build(
job: 'Update_Servers',
parameters: [
string(name: 'SERVER_TYPE', value: 'VMs'),
string(name: 'ENV', value: 'dev'),
string(name: 'SERVERS', value: 'all')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Servers - VMs - Dev - All failed. Aborting pipeline.")
}
}
}
}

stage('Update Servers - VMs - Prod - Pmx01') {
stage('Update Servers - LXC Core01') {
steps {
script {
def result = build(
job: 'Update_Servers',
parameters: [
string(name: 'SERVER_TYPE', value: 'VMs'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'pmx01')
string(name: 'SERVERS', value: 'lxc_core01')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Servers - VMs - Prod - Pmx01 failed. Aborting pipeline.")
error("Update Servers - Core01 failed. Aborting pipeline.")
}
}
}
}

stage('Update Servers - VMs - Prod - Pmx02') {
stage('Update Servers - LXC Core02') {
steps {
script {
def result = build(
job: 'Update_Servers',
parameters: [
string(name: 'SERVER_TYPE', value: 'VMs'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'pmx02')
string(name: 'SERVERS', value: 'lxc_core02')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Servers - VMs - Prod - Pmx02 failed. Aborting pipeline.")
error("Update Servers - Core02 failed. Aborting pipeline.")
}
}
}
}

stage('Update Servers - VPS - Prod - All') {
stage('Update Servers - VPS') {
steps {
script {
def result = build(
job: 'Update_Servers',
parameters: [
string(name: 'SERVER_TYPE', value: 'VPS'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'all')
string(name: 'SERVERS', value: 'vps')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Servers - VPS - Prod - All failed. Aborting pipeline.")
error("Update Servers - VPS failed. Aborting pipeline.")
}
}
}
}

stage('Update Servers - Rasp - Prod - All') {
stage('Update Servers - Rasp') {
steps {
script {
def result = build(
job: 'Update_Servers',
parameters: [
string(name: 'SERVER_TYPE', value: 'Rasp'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'all')
string(name: 'SERVERS', value: 'rasp')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Servers - Rasp - Prod - All failed. Aborting pipeline.")
error("Update Servers - Rasp failed. Aborting pipeline.")
}
}
}
}

stage('Update Servers - Proxmox - Prod - Pmx02') {
stage('Update Servers - Core02') {
steps {
script {
def result = build(
job: 'Update_Servers',
parameters: [
string(name: 'SERVER_TYPE', value: 'Proxmox'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'pmx02')
string(name: 'SERVERS', value: 'core02.rc')
],
propagate: true,
wait: true
)
if (result == 'FAILURE') {
error("Update Servers - Proxmox - Prod - Pmx02 failed. Aborting pipeline.")
error("Update Servers - Core02 failed. Aborting pipeline.")
}
input("Proceed with Update Servers - Proxmox - Prod - Pmx01?")
input("Proceed with Update Servers - Core01?")
}
}
}

stage('Update Servers - Proxmox - Prod - Pmx01') {
stage('Update Servers - Core01') {
steps {
script {
catchError(buildResult: 'FAILURE', stageResult: 'SUCCESS') {
build(
job: 'Update_Servers',
parameters: [
string(name: 'SERVER_TYPE', value: 'Proxmox'),
string(name: 'ENV', value: 'prod'),
string(name: 'SERVERS', value: 'pmx01')
string(name: 'SERVERS', value: 'core01.rc')
],
propagate: true,
wait: true
Expand Down
7 changes: 7 additions & 0 deletions Ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[defaults]
force_color = True
host_key_checking = False
interpreter_python = "/usr/bin/python3"
inventory = inventory
roles_path = roles
retry_files_enabled = False
1 change: 0 additions & 1 deletion Ansible/inventories/Antiz.fr/dev

This file was deleted.

1 change: 0 additions & 1 deletion Ansible/inventories/Antiz.fr/prod

This file was deleted.

9 changes: 0 additions & 9 deletions Ansible/inventories/Proxmox/prod

This file was deleted.

2 changes: 0 additions & 2 deletions Ansible/inventories/Rasp/prod

This file was deleted.

1 change: 0 additions & 1 deletion Ansible/inventories/Template/inventory

This file was deleted.

13 changes: 0 additions & 13 deletions Ansible/inventories/VMs/dev

This file was deleted.

69 changes: 0 additions & 69 deletions Ansible/inventories/VMs/prod

This file was deleted.

7 changes: 0 additions & 7 deletions Ansible/inventories/VPS/prod

This file was deleted.

Loading
Loading