Gettting idempotent error while testing using molecule in travis ci

8 views
Skip to first unread message

b hemanth

unread,
Jan 16, 2019, 1:30:44 AM1/16/19
to Ansible Project
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. 
Reply all
Reply to author
Forward
0 new messages