Compare commits

..

No commits in common. "6377a2421900c0dd1476e17eef87882ca3ff2396" and "71140b43befeca16fe95cf5be699960e7370f382" have entirely different histories.

3 changed files with 45 additions and 42 deletions

View File

@ -1,3 +1,2 @@
skip_list: skip_list:
- yaml[line-length] - yaml[line-length]
- yaml[colons]

View File

@ -1,24 +1,12 @@
--- ---
global-variables: name: Ansible Playbook Lint and Test Execution
ansible_image: &ansible_image "gitea.thezengarden.net/podman/images/ansible-dev:latest"
ansible_inventory: &ansible_inventory "-i 127.0.0.1, --connection=local"
ansible_playbook: &ansible_playbook "hello.yml"
name: run_ansible_tests
kind: pipeline kind: pipeline
type: docker type: docker
environment:
ANSIBLE_INVENTORY : *ansible_inventory
ANSIBLE_PLAYBOOK : *ansible_playbook
ANSIBLE_DOCKER_IMAGE : *ansible_image
steps: steps:
- name: "ansible_environment_verify" - name: "Verify environment"
image: *ansible_image image: gitea.thezengarden.net/podman/images/ansible-dev:latest
commands: commands:
- git log -1 - git log -1
- ansible --version - ansible --version
@ -29,34 +17,50 @@ steps:
event: [push] event: [push]
- name: "ansible_galaxy_requirements"
image: *ansible_image ###############################################################################
commands: ###############################################################################
- ansible-galaxy install -r $DRONE_WORKSPACE/requirements.yml ###############################################################################
when:
branch:
- development
event: [push]
- name: "ansible_lint" # - name: "Ansible-Galaxy: Install from requirements.yml"
image: *ansible_image # image: gitea.thezengarden.net/podman/images/ansible-dev:latest
commands: # commands:
- ansible-lint --offline $DRONE_WORKSPACE # - ansible-galaxy install -r $DRONE_WORKSPACE/requirements.yml
when: # when:
branch: # branch:
- development # - development
event: [push] # event:
# exclude:
# - pull_request
- name: "ansible_playbook_execution" # - name: "Syntax check and Ansible Lint"
image: *ansible_image # image: gitea.thezengarden.net/podman/images/ansible-dev:latest
commands: # commands:
- ansible-playbook -v $ANSIBLE_INVENTORY $DRONE_WORKSPACE/$ANSIBLE_PLAYBOOK # - ansible-lint --offline $DRONE_WORKSPACE
when: # - ansible-playbook --syntax-check $DRONE_WORKSPACE/hello.yml
branch: # when:
- development # branch:
event: [push] # - development
# event:
# exclude:
# - pull_request
# - name: "Test playbook execution"
# image: gitea.thezengarden.net/podman/images/ansible-dev:latest
# environment:
# ANSIBLE_INVENTORY:
# from_secret: ansible_inventory
# commands:
# - ansible-playbook -v -i 127.0.0.1, --connection=local $DRONE_WORKSPACE/hello.yml
# when:
# branch:
# - development
# event:
# exclude:
# - pull_request
############################################################################### ###############################################################################

View File

@ -1,9 +1,9 @@
- name: Hello world - name: Hello world
hosts: all hosts: localhost
connection: local
become: false become: false
gather_facts: false gather_facts: false
tasks: tasks:
- name: Say Hello world - name: Say Hello world
ansible.builtin.debug: ansible.builtin.debug: