Hello team,
i have added creates argument for the command modules as below for
idempotent test, this ansible role is working good when tested in vagrant
environment.
- name: Cloning a repository
> git:
> repo: "{{ ci_repo }}"
> dest: "{{ ci_path }}"
> clone: true
> version: "{{ ci_branch }}"
> register: cloning
> when: foldercreate.changed
> tags:
> - ci
> - skip_ansible_lint
> - name: Compile with maven
> command: "{{ maven_create_command }}"
> args:
> chdir: "{{ ci_path }}"
> creates: "{{ ci_path }}"
> warn: false
> when: cloning.changed
> tags:
> - ci
> - skip_ansible_lint
> - name: Testing with maven
> command: "{{ maven_test_command }}"
> args:
> chdir: "{{ ci_path }}"
> creates: "{{ ci_path }}"
> warn: false
> when: cloning.changed
> tags:
> - ci
> - skip_ansible_lint
> - name: Packing with maven
> command: "{{ maven_artifacts_command }}"
> args:
> chdir: "{{ ci_path }}"
> creates: "{{ ci_path }}"
> warn: false
> when: cloning.changed
> tags:
> - ci
> - skip_ansible_lint'
when tested in travis ci using molecule for ansible lint.
--> Scenario: 'default'
> --> Action: 'idempotence'
> ERROR: Idempotence test failed because of the following tasks:
> * [instance] => hemanth22.ci : Creating a test directory
> * [instance] => hemanth22.ci : Cloning a repository
> * [instance] => hemanth22.ci : Compile program with maven
> * [instance] => hemanth22.ci : Testing program with maven
> * [instance] => hemanth22.ci : Packing program with maven
> * [instance] => hemanth22.ci : Destroying test directory
> An error occurred during the test sequence action: 'idempotence'. Cleaning
> up.
Can you please advice.
Thanks,
Hemanth.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/974ac31b-66a8-42d9-837f-c6913e20ae5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.