From ecd777bcc8181f3fb29e6cc6df0eed936944b8eb Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 20 Dec 2024 17:08:53 -0500 Subject: [PATCH] Initial project commit --- .ansible-lint | 5 ++++ .ci.env | 3 +++ .gitea/workflows/ansible-test.yml | 40 +++++++++++++++++++++++++++++++ survey.yml | 10 ++++++++ 4 files changed, 58 insertions(+) create mode 100644 .ansible-lint create mode 100644 .ci.env create mode 100644 .gitea/workflows/ansible-test.yml create mode 100644 survey.yml diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..b6d3809 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,5 @@ +skip_list: + - yaml[colons] + - yaml[empty-lines] + - yaml[line-length] + - no-changed-when diff --git a/.ci.env b/.ci.env new file mode 100644 index 0000000..916079f --- /dev/null +++ b/.ci.env @@ -0,0 +1,3 @@ +export ANSIBLE_LINT_EXCLUSION="--exclude collections/ansible_collections --exclude .gitea" +export ANSIBLE_INVENTORY="-i 127.0.0.1, --connection=local" +export ANSIBLE_PLAYBOOK="survey.yml" diff --git a/.gitea/workflows/ansible-test.yml b/.gitea/workflows/ansible-test.yml new file mode 100644 index 0000000..5357f19 --- /dev/null +++ b/.gitea/workflows/ansible-test.yml @@ -0,0 +1,40 @@ +name: Ansible Code Pipeline +run-name: ${{ gitea.actor }} is running Ansible Code Pipeline +on: + push: + branches: + - development + - main + +jobs: + Ansible-Development-Pipeline: + strategy: + matrix: + os: [ ansible-dev-centos9, ansible-dev-fedora39, ansible-dev-debian12 ] + runs-on: ${{ matrix.os }} + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Ansible Environment Verify + run: | + whoami + . ./.ci.env + env + git log -1 + ansible --version + ansible-lint --version + + - name: Install Ansible Galaxy Dependencies + run: | + ansible-galaxy install -r requirements.yml + + - name: Run Ansible-Lint + run: | + . ./.ci.env + ansible-lint --offline $ANSIBLE_LINT_EXCLUSION + + - name: Run Ansible-Playbook + run: | + . ./.ci.env + ansible-playbook -v $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK diff --git a/survey.yml b/survey.yml new file mode 100644 index 0000000..8cb4797 --- /dev/null +++ b/survey.yml @@ -0,0 +1,10 @@ +--- +- name: AAP and Surveys + hosts: all + gather_facts: false + become: false + + tasks: + - name: Say hello + ansible.builtin.debug: + msg: Hello world!