File tree Expand file tree Collapse file tree 4 files changed +5
-9
lines changed
Expand file tree Collapse file tree 4 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ script:
4343 - docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/${role}/tests/main.yml | tee -a ${idempotence}
4444 - >
4545 tail ${idempotence}
46- | grep -q 'failed=0'
46+ | grep -q 'changed=0.* failed=0'
4747 && (echo 'Idempotence test: pass' && exit 0)
4848 || (echo 'Idempotence test: fail' && exit 1)
4949
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ ROLE_PATH=/etc/ansible/roles/$(ROLE_NAME)
44TEST_VERSION =ansible --version
55TEST_SYNTAX =ansible-playbook -vv -i 'localhost,' -c local $(ROLE_PATH ) /tests/main.yml --syntax-check
66TEST_PLAYBOOK =ansible-playbook -vv -i 'localhost,' -c local $(ROLE_PATH ) /tests/main.yml
7- TEST_CMD =$(TEST_VERSION ) ; $(TEST_SYNTAX ) ; $(TEST_PLAYBOOK )
7+ TEST_IDEMPOTENT =$(TEST_PLAYBOOK ) | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
8+ TEST_CMD =$(TEST_VERSION ) ; $(TEST_SYNTAX ) ; $(TEST_PLAYBOOK ) ; $(TEST_IDEMPOTENT )
89
910ubuntu16.04 : dist=ubuntu-16.04
1011ubuntu16.04 : .run
Original file line number Diff line number Diff line change 11---
22
3+
34# Path to the environment file
45environment_file : /etc/environment
56# The environment file owner
Original file line number Diff line number Diff line change 99 register : environment_file_result
1010 changed_when : environment_file_result.state != "file"
1111
12- - name : Remove previous values
13- lineinfile :
14- dest : " {{ environment_file }}"
15- regexp : ' ^{{ item.key }}\ ?='
16- state : absent
17- with_dict : " {{ environment_config }}"
18-
1912- name : Configuring environment
2013 lineinfile :
2114 dest : " {{ environment_file }}"
15+ regexp : ' ^{{ item.key }}\ ?='
2216 line : " {{ item.key }}='{{ item.value }}'"
2317 with_dict : " {{ environment_config }}"
You can’t perform that action at this time.
0 commit comments