feat: add more stuff
This commit is contained in:
parent
075da97511
commit
4e2886dd59
12 changed files with 74 additions and 62 deletions
10
.gitignore
vendored
10
.gitignore
vendored
|
|
@ -1,9 +1 @@
|
|||
.ansible/
|
||||
.git/
|
||||
*.pyc
|
||||
*.pyo
|
||||
.molecule/
|
||||
.tox/
|
||||
*.log
|
||||
.venv/
|
||||
venv/
|
||||
.ansible
|
||||
|
|
|
|||
|
|
@ -1,26 +1,13 @@
|
|||
---
|
||||
|
||||
# gitlab stages
|
||||
stages:
|
||||
- lint
|
||||
- test
|
||||
- "gitleaks"
|
||||
- "linting"
|
||||
|
||||
variables:
|
||||
ANSIBLE_FORCE_COLOR: "true"
|
||||
|
||||
ansible-lint:
|
||||
stage: lint
|
||||
image: "registry.gitlab.com/siempie/ansible-runner:latest"
|
||||
script:
|
||||
- "ansible-lint"
|
||||
rules:
|
||||
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event'"
|
||||
- if: "$CI_COMMIT_BRANCH == 'main'"
|
||||
|
||||
molecule:
|
||||
stage: test
|
||||
image: "registry.gitlab.com/siempie/ansible-runner:latest"
|
||||
script:
|
||||
- "molecule test"
|
||||
rules:
|
||||
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event'"
|
||||
- if: "$CI_COMMIT_BRANCH == 'main'"
|
||||
# include components
|
||||
include:
|
||||
- component: "$CI_SERVER_FQDN/components/ansible/linting@v3.0.3"
|
||||
- component: "$CI_SERVER_FQDN/components/gitleaks/gitleaks@v1.0.0"
|
||||
- component: "$CI_SERVER_FQDN/components/markdownlint/markdownlint@1.0.0"
|
||||
- component: "$CI_SERVER_FQDN/components/yamllint/yamllint@1.0.2"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
{
|
||||
// files to lint
|
||||
"globs": [
|
||||
"readme.md"
|
||||
],
|
||||
// linting rules
|
||||
"config": {
|
||||
"MD004": false,
|
||||
"MD013": false,
|
||||
"MD030": false,
|
||||
"MD033": false
|
||||
"MD013": {
|
||||
"line_length": 120
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
30
.yamllint
30
.yamllint
|
|
@ -1,10 +1,30 @@
|
|||
---
|
||||
|
||||
extends: "default"
|
||||
extends: 'default'
|
||||
|
||||
rules:
|
||||
line-length:
|
||||
max: 120
|
||||
level: "warning"
|
||||
braces:
|
||||
max-spaces-inside: 1
|
||||
forbid: true
|
||||
comments:
|
||||
min-spaces-from-content: 1
|
||||
comments-indentation: false
|
||||
empty-lines:
|
||||
max: 2
|
||||
indentation:
|
||||
spaces: 2
|
||||
check-multi-line-strings: true
|
||||
line-length:
|
||||
max: 120
|
||||
allow-non-breakable-words: true
|
||||
allow-non-breakable-inline-mappings: true
|
||||
new-line-at-end-of-file: 'enable'
|
||||
octal-values:
|
||||
forbid-implicit-octal: true
|
||||
forbid-explicit-octal: true
|
||||
truthy:
|
||||
allowed-values:
|
||||
- 'true'
|
||||
- 'false'
|
||||
quoted-strings:
|
||||
quote-type: 'any'
|
||||
required: true
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
galaxy_info:
|
||||
author: "siempie"
|
||||
description: "install and configure phpipam"
|
||||
description: "install phpipam"
|
||||
license: "MIT"
|
||||
role_name: "phpipam"
|
||||
dependencies: []
|
||||
dependencies:
|
||||
- role: "docker"
|
||||
- role: "traefik"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
---
|
||||
|
||||
# install phpipam
|
||||
- name: "install phpipam"
|
||||
hosts: "all"
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
# due to semaphore bug we need to do this ourselves
|
||||
- name: "force-update requirements"
|
||||
ansible.builtin.command:
|
||||
cmd: "ansible-galaxy install -f -r roles/requirements.yml"
|
||||
|
|
@ -12,6 +15,7 @@
|
|||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
# execute the role
|
||||
- name: "execute role: phpipam"
|
||||
ansible.builtin.include_role:
|
||||
name: "phpipam"
|
||||
|
|
|
|||
|
|
@ -1,12 +1,4 @@
|
|||
{
|
||||
"extends": [
|
||||
"config:base"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchPackagePatterns": ["*"],
|
||||
"matchUpdateTypes": ["patch", "minor", "major"],
|
||||
"groupName": "all"
|
||||
}
|
||||
]
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [ "local>cicd/renovate:ansible" ]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ roles:
|
|||
src: "https://gitlab.simoncor.net/ansible/ans-docker.git"
|
||||
scm: "git"
|
||||
- name: "phpipam"
|
||||
src: "https://gitlab.simoncor.net/ansible/ans-ipam.git"
|
||||
src: "https://gitlab.simoncor.net/ansible/ans-phpipam.git"
|
||||
scm: "git"
|
||||
- name: "traefik"
|
||||
src: "https://gitlab.simoncor.net/ansible/ans-traefik.git"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,17 @@
|
|||
---
|
||||
|
||||
# create network
|
||||
- name: "create network"
|
||||
ansible.builtin.import_tasks: "network.yaml"
|
||||
|
||||
# install mariadb
|
||||
- name: "install mariadb"
|
||||
ansible.builtin.import_tasks: "mariadb.yaml"
|
||||
|
||||
# install phpipam
|
||||
- name: "install phpipam"
|
||||
ansible.builtin.import_tasks: "phpipam.yaml"
|
||||
|
||||
# cleanup docker
|
||||
- name: "cleanup docker"
|
||||
ansible.builtin.import_tasks: "cleanup.yaml"
|
||||
|
|
|
|||
|
|
@ -32,12 +32,13 @@
|
|||
tty: "no"
|
||||
|
||||
# run mariadb
|
||||
name: "ipam-db"
|
||||
name: "phpipam-db"
|
||||
image: "docker.io/mariadb:lts"
|
||||
image_name_mismatch: "recreate"
|
||||
restart_policy: "unless-stopped"
|
||||
networks:
|
||||
- name: "ipam-network"
|
||||
- name: "phpipam"
|
||||
|
||||
volumes:
|
||||
- "/mnt/ipam/mysql:/var/lib/mysql"
|
||||
|
||||
|
|
|
|||
9
tasks/network.yaml
Normal file
9
tasks/network.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
# create network
|
||||
- name: "docker - create phpipam network"
|
||||
community.docker.docker_network:
|
||||
name: "phpipam"
|
||||
driver: "bridge"
|
||||
state: "present"
|
||||
|
||||
|
|
@ -8,12 +8,6 @@
|
|||
group: "root"
|
||||
mode: "0775"
|
||||
|
||||
- name: "create ipam network"
|
||||
community.docker.docker_network:
|
||||
name: "ipam-network"
|
||||
driver: "bridge"
|
||||
state: "present"
|
||||
|
||||
- name: "run phpipam"
|
||||
community.docker.docker_container:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue