I am trying to write a pipeline to lint and execute my ansible code for testing. I am using a service to do this. Would something like this actually be possible?
Below is my drone.yml file.
---
kind: pipeline
type: docker
name: default
services:
- name: photon
image: photon:latest
steps:
- name: Lint Ansible Playbook
image: plugins/ansible:2
settings:
playbook: playbook.yml
syntax_check: true
inventory: ./inventory
verbose: 2
- name: Run Ansible Playbook
image: plugins/ansible:2
settings:
playbook: playbook.yml
connection: docker
syntax_check: false
inventory: ./inventory
verbose: 3
list_hosts: true
The error that I get is:
$ ansible --version
ansible 2.8.4
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.7.3 (default, May 3 2019, 11:24:39) [GCC 8.3.0]
$ ansible-playbook --inventory ./inventory --connection docker playbook.yml
PLAY [Test Playbook] ***********************************************************
TASK [Gathering Facts] *********************************************************
fatal: [photon]: FAILED! => {"msg": "docker command not found in PATH"}
PLAY RECAP *********************************************************************
photon : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
exit status 2