CI for the TripleO project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pre.yaml 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. - hosts: all
  2. name: TripleO Setup Container Registry and repos mirror
  3. roles:
  4. - role: tripleo-repos
  5. tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/tripleo-repos'].src_dir }}"
  6. tasks:
  7. - name: Include common vars
  8. include_vars:
  9. file: "common.yaml"
  10. - name: Ensure legacy workspace directory
  11. file:
  12. path: '{{ workspace }}'
  13. state: directory
  14. - name: Setup docker registry
  15. block:
  16. - name: Install ansible
  17. become: true
  18. package:
  19. name: ansible
  20. state: present
  21. - name: Create playbook structure
  22. file:
  23. path: '{{ workspace }}/container-registry'
  24. src: '{{ openstack_git_root }}/ansible-role-container-registry'
  25. state: link
  26. - name: Configure docker registry
  27. template:
  28. src: templates/docker-playbook.yaml.j2
  29. dest: '{{ workspace }}/docker-playbook.yaml'
  30. mode: 0644
  31. force: yes
  32. - name: Run ansible playbook to configure docker
  33. args:
  34. chdir: '{{ workspace }}'
  35. shell: |
  36. ansible-playbook docker-playbook.yaml --extra-vars "container_registry_deployment_user={{ ansible_user }}"
  37. - name: Add docker masquerading rules
  38. become: true
  39. command: iptables -t nat -A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE
  40. - name: Reset connection because of group changes for current user
  41. meta: reset_connection
  42. - name: Setup repo web service
  43. become: true
  44. block:
  45. - name: Install apache
  46. package:
  47. name: httpd
  48. state: present
  49. - name: Start apache
  50. service:
  51. name: httpd
  52. state: running
  53. - name: Fetch delorean repos
  54. shell: |
  55. set -ex
  56. cp /etc/yum.repos.d/delorean* /var/www/html/