diff --git a/.travis.yml b/.travis.yml index 85469a186..d0353976e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,8 +37,10 @@ install: script: - cd tests - - docker-compose config --services | grep $PLATFORM | xargs docker-compose up -d - - ansible-playbook $PLAYBOOK -l $PLATFORM + - docker-compose config --services | grep "$PLATFORM" | xargs docker-compose up -d + - ansible-playbook $PLAYBOOK -l "$PLATFORM:&latest" --check --diff + - ansible-playbook $PLAYBOOK -l "$PLATFORM" -vv + - ansible-playbook $PLAYBOOK -l "$PLATFORM:&latest" --check --diff before_cache: # Put docker images used during this run into travis cache (if not already cached). diff --git a/tasks/main.yml b/tasks/main.yml index 383ebe18d..c6582e6cc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,7 +5,16 @@ become: yes become_user: '{{ rvm1_user }}' +- name: Check that RVM is installed + stat: + path: '{{ rvm1_rvm }}' + register: rvm_binary_check + ignore_errors: ansible_check_mode + changed_when: no + check_mode: no # Run in normal mode when in --check mode (http://docs.ansible.com/ansible/playbooks_checkmode.html) + - name: Install Ruby and Gems import_tasks: 'rubies.yml' become: yes become_user: '{{ rvm1_user }}' + when: rvm_binary_check.stat.exists diff --git a/tasks/rubies.yml b/tasks/rubies.yml index de968a182..d0c34f54b 100644 --- a/tasks/rubies.yml +++ b/tasks/rubies.yml @@ -4,6 +4,7 @@ command: '{{ rvm1_rvm }} list strings' register: rvm_list_strings changed_when: False + check_mode: no # Run in normal mode when in --check mode (http://docs.ansible.com/ansible/playbooks_checkmode.html) - name: Install rubies command: '{{ rvm1_rvm }} install {{ item }} {{ rvm1_ruby_install_flags }}' diff --git a/tests/inventory b/tests/inventory index 8467d29c9..420f7c98f 100644 --- a/tests/inventory +++ b/tests/inventory @@ -13,3 +13,8 @@ tests_ubuntu14_1 ansible_connection=docker tests_ubuntu16_1 ansible_connection=docker tests_ubuntu18_1 ansible_connection=docker tests_ubuntu20_1 ansible_connection=docker + +[latest] +tests_centos8_1 +tests_debian10_1 +tests_ubuntu20_1 diff --git a/tests/root.yml b/tests/root.yml index 0372b0d25..abfbedff6 100644 --- a/tests/root.yml +++ b/tests/root.yml @@ -20,4 +20,5 @@ rvm1_install_path: '/opt/rvm' tasks: - import_tasks: assertions.yml + when: not ansible_check_mode tags: validate \ No newline at end of file diff --git a/tests/user.yml b/tests/user.yml index d7f77dfc6..2c7958004 100644 --- a/tests/user.yml +++ b/tests/user.yml @@ -22,4 +22,5 @@ rvm1_install_path: '/home/user/.rvm' tasks: - import_tasks: assertions.yml + when: not ansible_check_mode tags: validate \ No newline at end of file