diff --git a/README.md b/README.md index 1daaa6646..cfb91e83f 100644 --- a/README.md +++ b/README.md @@ -343,3 +343,4 @@ It contains the following roles: For example, since docker-container contains the Ansible scripts for creating a Docker container, and it is a very common task shared by many products, it makes sense to have it in common so it can be referred to by other products. Whenever you create a role, if it will likely be used by other products (e.g. it's not very specific to your product), please put it under common roles, or if it's for installing some commonly used program, put it under installation. + diff --git a/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/test_teleop_server.py b/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/test_teleop_server.py index 2b0cd6cc4..580c87ebd 100644 --- a/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/test_teleop_server.py +++ b/ansible/playbooks/molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/test_teleop_server.py @@ -131,6 +131,7 @@ def test_icons_in_docker(host): 'shadow_zero_force_mode_right', 'close_everything' ) + check_things_exist(host=host, extension='desktop', path_to_test=desktop_path, things=icons, type_of_thing='icon') check_things_exist(host=host, extension='sh', path_to_test=script_path, things=scripts, type_of_thing='script') diff --git a/ansible/playbooks/molecule_ec2_local_inventories/molecule/default_ec2/molecule.yml b/ansible/playbooks/molecule_ec2_local_inventories/molecule/default_ec2/molecule.yml index c4d13d17b..ba49af49c 100644 --- a/ansible/playbooks/molecule_ec2_local_inventories/molecule/default_ec2/molecule.yml +++ b/ansible/playbooks/molecule_ec2_local_inventories/molecule/default_ec2/molecule.yml @@ -26,7 +26,7 @@ lint: | platforms: # Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild - name: default_ec2_${CODEBUILD_BUILD_ID} - image: ami-0820357ff5cf2333d + image: ami-04fb05b6fe799fe85 instance_type: t2.micro region: eu-west-2 vpc_id: vpc-0f8cc2cc245d57eb4 diff --git a/ansible/playbooks/molecule_ec2_local_inventories/molecule/hand_e_empty_machine_docker_ec2/molecule.yml b/ansible/playbooks/molecule_ec2_local_inventories/molecule/hand_e_empty_machine_docker_ec2/molecule.yml index 094643774..0373e1114 100644 --- a/ansible/playbooks/molecule_ec2_local_inventories/molecule/hand_e_empty_machine_docker_ec2/molecule.yml +++ b/ansible/playbooks/molecule_ec2_local_inventories/molecule/hand_e_empty_machine_docker_ec2/molecule.yml @@ -26,7 +26,7 @@ lint: | platforms: # Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild - name: hand_e_empty_machine_docker_ec2_${CODEBUILD_BUILD_ID} - image: ami-0820357ff5cf2333d + image: ami-04fb05b6fe799fe85 instance_type: t2.micro region: eu-west-2 vpc_id: vpc-0f8cc2cc245d57eb4 diff --git a/ansible/roles/products/common/docker-container/tasks/modify-container.yml b/ansible/roles/products/common/docker-container/tasks/modify-container.yml index 0bb71c91a..d7e57f9d1 100644 --- a/ansible/roles/products/common/docker-container/tasks/modify-container.yml +++ b/ansible/roles/products/common/docker-container/tasks/modify-container.yml @@ -23,9 +23,23 @@ become: yes changed_when: false -- name: Please wait and don't close the empty terminator window while aurora is executing the modify container script with these commands {{ modify_script_commands }} +- name: Set use_retries to false if unspecified + ansible.builtin.set_fact: + use_retries: "{{ use_retries | default('false') }}" + +- name: Please wait and don't close the empty terminator window while aurora is executing the modify container script with these commands {{ modify_script_commands }} without retries + shell: "/tmp/{{ modify_script_name }}" + become: yes + changed_when: false + register: result + when: not skip_molecule_task|bool and not use_retries|bool + +- name: Please wait and don't close the empty terminator window while aurora is executing the modify container script with these commands {{ modify_script_commands }} with retries shell: "/tmp/{{ modify_script_name }}" become: yes changed_when: false - when: not skip_molecule_task|bool - + retries: 10 + delay: 3 + register: result + until: '"finished_successfully" in result.stdout' + when: not skip_molecule_task|bool and use_retries|bool diff --git a/ansible/roles/products/common/docker-container/tasks/reinstall.yml b/ansible/roles/products/common/docker-container/tasks/reinstall.yml index 814a8db19..882df09fb 100644 --- a/ansible/roles/products/common/docker-container/tasks/reinstall.yml +++ b/ansible/roles/products/common/docker-container/tasks/reinstall.yml @@ -111,4 +111,5 @@ import_tasks: modify-container.yml vars: modify_script_name: "pull_sr_hand_config.sh" - modify_script_commands: "if roscd sr_hand_config; then roscd sr_hand_config && git remote set-url origin https://github.com/shadow-robot/sr_hand_config && git pull; else roscd sr_config && git remote set-url origin https://github.com/shadow-robot/sr-config && git pull; fi" + modify_script_commands: "if roscd sr_hand_config; then roscd sr_hand_config && git remote set-url origin https://github.com/shadow-robot/sr_hand_config && timeout 30 git pull && echo 'finished_successfully'; else roscd sr_config && git remote set-url origin https://github.com/shadow-robot/sr-config && timeout 30 git pull && echo 'finished_successfully'; fi" + use_retries: true