troykinsella / concourse-ansible-playbook-resource

A Concourse CI resource for running Ansible playbooks
MIT License
40 stars 20 forks source link

Return success but doing nothing #12

Closed rk-p2p closed 4 years ago

rk-p2p commented 4 years ago

Hello. With new release something wrong, because resource doesn't run playbook but return success. Can you check it, please? My pipeline config:

resource_types:
  - name: ansible-playbook
    type: docker-image
    source:
      repository: troykinsella/concourse-ansible-playbook-resource
      tag: latest
resources:
  - name: ci-src
    type: git
    icon: github-circle
    source:
      branch: master
      uri: ((git.uri))
      private_key: ((ssh.private_key))

  - name: ansible-playbook
    type: ansible-playbook
    icon: ansible
    source:
      debug: true
      verbose: vvv
      env:
        ANSIBLE_DEPRECATION_WARNINGS: "False"
      user: root
      ssh_private_key: ((ssh.private_key))
jobs:
  - name: Run playbook
    plan:
      - get: ci-src
      - put: ansible-playbook
        params:
          check: false
          diff: false
          inventory: .ci/ansible/inventory/inventory.yml
          playbook: .ci/ansible/playbook.yml
          path: ci-src
          vars:
            host: test

My playbook (for testing purposes)

- hosts: "{{ host }}"
  gather_facts: no
  become: true
  vars:
    ansible_python_interpreter: /usr/bin/python3
  tasks:
    - name: test latest ansible concourse-ci resource
      shell: echo Successfull! > ~/.test

concourse-ci anisble step log:

ansible-playbook      --extra-vars '{"host":"test"}' -i .ci/ansible/inventory/inventory.yml  --private-key /tmp/ansible-playbook-resource-ssh-private-key   --user root   -vvv .ci/ansible/playbook.yml
troykinsella commented 4 years ago

In my testing, an issue that was introduced in #11 has been fixed in #13. Please test against the latest tag and confirm for me.

FYI, you are able to pin the resource image to a versioned tag, as I tag a bumped version number every release. See available tags: https://hub.docker.com/repository/docker/troykinsella/concourse-ansible-playbook-resource/tags?page=1

Thanks for the report, and apologies for the breakage!

rk-p2p commented 4 years ago

to pin the resource image to a versioned tag

I had to pin a version of the resource in all my projects when everything broke down.

Checked it out. It's working now. Thank you for your help!