Unreal amounts of linter fixes
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 4s
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 16s

This commit is contained in:
shockrah 2025-05-26 01:10:00 -07:00
parent 8ef606153f
commit 75b7f2fa3d
15 changed files with 39 additions and 122 deletions

View File

@ -10,6 +10,6 @@ jobs:
steps:
- name: Checkout repo content
uses: actions/checkout@v4
- run: ansible-lint
- run: ansible-lint -c linter.yaml
working-directory: ansible/

View File

@ -1,3 +1,3 @@
nigel:
hosts:
nigel.local:
nigel.local:

View File

@ -1,4 +1,4 @@
---
skip_list:
- role-name
- var-naming[no-role-prefix]
- var-naming[no-role-prefix]

View File

@ -2,14 +2,15 @@
# The rest of the role stuff is meant to be ran as the admin user that
# this playbook creates for us
---
- hosts: nigel.local
- name: Setup local admin user with a fresh ubuntu host
hosts: nigel.local
remote_user: nigel
vars:
admin:
username: nigel
tasks:
- name: Copy the nigel admin key
ansible.builtin.authorized_key:
ansible.posix.authorized_key:
user: "{{ admin.username }}"
state: present
key: "{{ lookup('file', '~/.ssh/nigel/admin.pub') }}"
@ -24,4 +25,4 @@
become: true
ansible.builtin.service:
name: ssh
state: restarted
state: restarted

View File

@ -1,5 +1,6 @@
---
- hosts: nigel.local
- name: Setup bare metal requirements for nomad
hosts: nigel.local
remote_user: nigel
tasks:
- name: Setup basic role on nigel

View File

@ -1,7 +1,8 @@
---
- hosts: nigel.local
- name: Setup host as a reverse proxy
hosts: nigel.local
remote_user: nigel
tasks:
- name: Apply reverse proxy role
ansible.builtin.include_role:
name: proxy
name: proxy

View File

@ -22,4 +22,4 @@
apply:
become: true
tags:
- nomad
- nomad

View File

@ -10,25 +10,26 @@
keypath: /usr/share/keyrings/hashicorp-archive-keyring.gpg
gpgpath: /tmp/hashicorp.gpg
block:
- name: Download the hashicorp GPG Key
ansible.builtin.get_url:
url: https://apt.releases.hashicorp.com/gpg
dest: "{{ gpgpath }}"
- name: Dearmor the hashicorp gpg key
ansible.builtin.command:
cmd: "gpg --dearmor --yes -o {{ keypath }} {{ gpgpath }}"
register: gpg
changed_when: gpg.rc == 0
- name: Add the hashicorp linux repo
vars:
keyfile: "{{ keypath }}"
ansible.builtin.template:
src: hashicorp.list
dest: /etc/apt/sources.list.d/hashicorp.list
mode: "0644"
- name: Update apt repo cache
ansible.builtin.apt:
update_cache: true
- name: Download the hashicorp GPG Key
ansible.builtin.get_url:
url: https://apt.releases.hashicorp.com/gpg
dest: "{{ gpgpath }}"
mode: "0755"
- name: Dearmor the hashicorp gpg key
ansible.builtin.command:
cmd: "gpg --dearmor --yes -o {{ keypath }} {{ gpgpath }}"
register: gpg
changed_when: gpg.rc == 0
- name: Add the hashicorp linux repo
vars:
keyfile: "{{ keypath }}"
ansible.builtin.template:
src: hashicorp.list
dest: /etc/apt/sources.list.d/hashicorp.list
mode: "0644"
- name: Update apt repo cache
ansible.builtin.apt:
update_cache: true
- name: Install consul
ansible.builtin.apt:
name: consul
@ -36,7 +37,7 @@
ansible.builtin.apt:
pkg: nomad
- name: Copy in the consul configuration
vars:
vars:
ip: "{{ ansible_default_ipv4['address'] }}"
ansible.builtin.template:
src: consul.hcl
@ -51,4 +52,4 @@
ansible.builtin.systemd_service:
name: consul
state: stopped
enabled: true
enabled: true

View File

@ -1 +0,0 @@
host_vol_root: /opt/volumes

View File

@ -2,7 +2,9 @@
ansible.builtin.file:
path: "{{ nomad.volumes.root }}"
state: directory
mode: "0755"
- name: Ensure registry volume is present
ansible.builtin.file:
path: "{{ nomad.volumes.registry }}"
state: directory
state: directory
mode: "0755"

View File

@ -1,3 +1,3 @@
proxy_nginx_configs:
- nomad.conf
- ncr.conf
- ncr.conf

View File

@ -1,40 +0,0 @@
networks:
gitea:
external: false
services:
gitea:
image: gitea/gitea:latest-rootless
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
networks:
- gitea
volumes:
- /opt/containers/gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "2222:22"
gitea-runner:
image: gitea/act_runner:nightly
container_name: gitea-runner
restart: always
networks:
- gitea
volumes:
- /opt/containers/gitea_runner/
- /var/run/docker.sock:/var/run/docker.sock
environment:
- GITEA_INSTANCE_URL=https://git.shockrah.xyz
- GITEA_RUNNER_NAME=gitea-main
- GITEA_RUNNER_LABELS=gitea-main
- GITEA_RUNNER_REGISTRATION_TOKEN=${token}

View File

@ -1,29 +0,0 @@
What is this
============
Here we contain scripts to build out all the containers that are run.
All of these images are based on images that are made from other projects
docker-compose.yaml
===================
Services that are more/less "special" go here since most of the stuff that is
run on the main host are basically just static html websites
Services & Containers
=====================
| Service | Docker Image Used |
|------------|--------------------------|
| Gitea | gitea/gitea:latest |
| Act Runner | gitea/act_runner:nightly |
Why the servics above?
======================
The Gitea related services are there so that I can host my own Git projects
away from "Git as a service" services. I have no issue with Github/Gitlab
but I just like being able to host my own stuff when possible :smiley:

View File

@ -1,4 +0,0 @@
# Because I just really needed ok?
FROM nginx:latest
COPY default /etc/nginx/conf.d/default.conf

View File

@ -1,15 +0,0 @@
server {
listen 8080;
listen [::]:8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}