This commit is contained in:
65
.drone.yml
Normal file
65
.drone.yml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: exec
|
||||||
|
name: ansible_dev_centos_stream9
|
||||||
|
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
exclude:
|
||||||
|
- main
|
||||||
|
event: [push]
|
||||||
|
status: [success]
|
||||||
|
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: check_env
|
||||||
|
commands:
|
||||||
|
- hostnamectl
|
||||||
|
- env
|
||||||
|
- whoami
|
||||||
|
- pwd
|
||||||
|
- tree
|
||||||
|
|
||||||
|
- name: docker_info
|
||||||
|
commands:
|
||||||
|
- docker info
|
||||||
|
|
||||||
|
- name: docker_login
|
||||||
|
environment:
|
||||||
|
REGISTRY : gitea.thezengarden.net
|
||||||
|
GITEA_USER :
|
||||||
|
from_secret: gitea_user
|
||||||
|
GITEA_PASSWORD :
|
||||||
|
from_secret: gitea_password
|
||||||
|
commands:
|
||||||
|
- echo "$GITEA_PASSWORD" | docker login --username chris --password-stdin $REGISTRY
|
||||||
|
|
||||||
|
- name: docker_build
|
||||||
|
environment:
|
||||||
|
REGISTRY : gitea.thezengarden.net
|
||||||
|
BUILD_PREFIX : podman/ansible-dev
|
||||||
|
BUILD_NAME : centos9
|
||||||
|
BUILD_TAG : "$CI_COMMIT_BRANCH-$CI_BUILD_NUMBER"
|
||||||
|
commands:
|
||||||
|
- echo "docker build -f build/Containerfile.centos-stream9 -t $REGISTRY/$BUILD_PREFIX/$BUILD_NAME:$BUILD_TAG ."
|
||||||
|
- docker build -f build/Containerfile.centos-stream9 -t $REGISTRY/$BUILD_PREFIX/$BUILD_NAME:$BUILD_TAG .
|
||||||
|
|
||||||
|
- name: docker_push
|
||||||
|
environment:
|
||||||
|
REGISTRY : gitea.thezengarden.net
|
||||||
|
BUILD_PREFIX : podman/ansible-dev
|
||||||
|
BUILD_NAME : centos9
|
||||||
|
BUILD_TAG : "$CI_COMMIT_BRANCH-$CI_BUILD_NUMBER"
|
||||||
|
commands:
|
||||||
|
- docker push $REGISTRY/$BUILD_PREFIX/$BUILD_NAME:$BUILD_TAG
|
||||||
|
- docker images | grep "$REGISTRY/$BUILD_PREFIX/$BUILD_NAME"
|
||||||
|
|
||||||
|
- name: docker_images
|
||||||
|
environment:
|
||||||
|
REGISTRY : gitea.thezengarden.net
|
||||||
|
BUILD_PREFIX : podman/ansible-dev
|
||||||
|
BUILD_NAME : centos9
|
||||||
|
BUILD_TAG : "$CI_COMMIT_BRANCH-$CI_BUILD_NUMBER"
|
||||||
|
commands:
|
||||||
|
- docker images | grep "$REGISTRY/$BUILD_PREFIX/$BUILD_NAME"
|
11
ansible/ansible-check.yml
Normal file
11
ansible/ansible-check.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
- name: Ansible Installation Verification
|
||||||
|
hosts: all
|
||||||
|
become: false
|
||||||
|
gather_facts: true
|
||||||
|
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Test Ansible Installation
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "Ansible is successfully installed on {{ inventory_hostname }}!"
|
21
build/Containerfile.centos-stream9
Normal file
21
build/Containerfile.centos-stream9
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM quay.io/centos/centos:stream9
|
||||||
|
LABEL maintainer="Chris Hammer (chris@thezengarden.net)"
|
||||||
|
|
||||||
|
RUN rm /etc/localtime \
|
||||||
|
&& ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
|
||||||
|
|
||||||
|
RUN mkdir -p /root/.ssh
|
||||||
|
COPY conf/ssh_config /root/.ssh/config
|
||||||
|
COPY conf/hosts /etc/hosts
|
||||||
|
COPY conf/dnf.conf /etc/dnf/dnf.conf
|
||||||
|
# COPY python/requirements.txt /tmp/requirements.txt
|
||||||
|
|
||||||
|
# RUN dnf install -y python3-pip git ansible-core python3-ansible-lint
|
||||||
|
RUN dnf update -y \
|
||||||
|
&& dnf install -y python3-pip git \
|
||||||
|
&& pip install pip --upgrade \
|
||||||
|
&& pip install -r /tmp/requirements.txt
|
||||||
|
|
||||||
|
COPY ansible/ansible-check.yml /tmp/ansible-check.yml
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
18
build/Containerfile.debian-11
Normal file
18
build/Containerfile.debian-11
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM docker.io/debian:11
|
||||||
|
LABEL maintainer="Chris Hammer (chris@thezengarden.net)"
|
||||||
|
|
||||||
|
RUN rm /etc/localtime \
|
||||||
|
&& ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
|
||||||
|
|
||||||
|
RUN mkdir -p /root/.ssh
|
||||||
|
COPY conf/ssh_config /root/.ssh/config
|
||||||
|
COPY conf/hosts /etc/hosts
|
||||||
|
|
||||||
|
RUN apt update \
|
||||||
|
&& apt dist-upgrade -y \
|
||||||
|
&& apt autoremove --purge -y \
|
||||||
|
&& apt install -y ansible-core ansible-lint git
|
||||||
|
|
||||||
|
COPY ansible/ansible-check.yml /tmp/ansible-check.yml
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
18
build/Containerfile.debian-12
Normal file
18
build/Containerfile.debian-12
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM docker.io/debian:12
|
||||||
|
LABEL maintainer="Chris Hammer (chris@thezengarden.net)"
|
||||||
|
|
||||||
|
RUN rm /etc/localtime \
|
||||||
|
&& ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
|
||||||
|
|
||||||
|
RUN mkdir -p /root/.ssh
|
||||||
|
COPY conf/ssh_config /root/.ssh/config
|
||||||
|
COPY conf/hosts /etc/hosts
|
||||||
|
|
||||||
|
RUN apt update \
|
||||||
|
&& apt dist-upgrade -y \
|
||||||
|
&& apt autoremove --purge -y \
|
||||||
|
&& apt install -y ansible-core ansible-lint git
|
||||||
|
|
||||||
|
COPY ansible/ansible-check.yml /tmp/ansible-check.yml
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
19
build/Containerfile.fedora39
Normal file
19
build/Containerfile.fedora39
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
FROM registry.fedoraproject.org/fedora:39
|
||||||
|
LABEL maintainer="Chris Hammer (chris@thezengarden.net)"
|
||||||
|
|
||||||
|
RUN rm /etc/localtime \
|
||||||
|
&& ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
|
||||||
|
|
||||||
|
RUN mkdir -p /root/.ssh
|
||||||
|
COPY conf/ssh_config /root/.ssh/config
|
||||||
|
COPY conf/hosts /etc/hosts
|
||||||
|
COPY conf/dnf.conf /etc/dnf/dnf.conf
|
||||||
|
# COPY python/requirements.txt /tmp/requirements.txt
|
||||||
|
|
||||||
|
RUN dnf install -y python3-pip git ansible-core python3-ansible-lint
|
||||||
|
# && pip install pip --upgrade \
|
||||||
|
# && pip install -r /tmp/requirements.txt
|
||||||
|
|
||||||
|
COPY ansible/ansible-check.yml /tmp/ansible-check.yml
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
7
conf/dnf.conf
Normal file
7
conf/dnf.conf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[main]
|
||||||
|
gpgcheck=1
|
||||||
|
installonly_limit=3
|
||||||
|
clean_requirements_on_remove=True
|
||||||
|
best=True
|
||||||
|
skip_if_unavailable=False
|
||||||
|
max_parallel_downloads=20
|
1
conf/hosts
Normal file
1
conf/hosts
Normal file
@ -0,0 +1 @@
|
|||||||
|
10.10.10.109 gitea.thezengarden.net
|
6
conf/ssh_config
Normal file
6
conf/ssh_config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
AddKeysToAgent yes
|
||||||
|
|
||||||
|
Host gitea gitea.thezengarden.net
|
||||||
|
Hostname 10.10.10.109
|
||||||
|
StrictHostKeyChecking no
|
||||||
|
UserKnownHostsFile=/dev/null
|
2
python/requirements.txt
Normal file
2
python/requirements.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ansible-core==2.14.11
|
||||||
|
ansible-lint==6.13.1
|
Reference in New Issue
Block a user