Role repo_server for OpenStack-Ansible
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.

repo_post_install.yml 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ---
  2. # Copyright 2016, Rackspace US, Inc.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. - name: Remove old key file(s) if found
  16. file:
  17. path: "{{ item }}"
  18. state: "absent"
  19. with_items:
  20. - "{{ repo_service_home_folder }}/.ssh/authorized_keys"
  21. - "{{ repo_service_home_folder }}/.ssh/id_rsa"
  22. - "{{ repo_service_home_folder }}/.ssh/id_rsa.pub"
  23. when: repo_recreate_keys | bool
  24. - name: Generate the nginx system user ssh key
  25. user:
  26. name: "{{ repo_service_user_name }}"
  27. generate_ssh_key: "yes"
  28. - name: Enable SSHD
  29. systemd:
  30. name: "{{ repo_server_sshd }}"
  31. state: started
  32. enabled: yes
  33. masked: no
  34. daemon_reload: yes
  35. - name: Drop NGINX configuration files
  36. template:
  37. src: "{{ item.src }}"
  38. dest: "{{ item.dest }}"
  39. with_items:
  40. - src: "nginx.conf.j2"
  41. dest: "/etc/nginx/nginx.conf"
  42. - src: "rsyncd.conf.j2"
  43. dest: "/etc/rsyncd.conf"
  44. - src: "openstack-slushee.vhost.j2"
  45. dest: "/etc/nginx/sites-available/openstack-slushee.vhost"
  46. - src: "nginx-pypi.conf.j2"
  47. dest: "/etc/nginx/conf.d/pypi.conf"
  48. notify:
  49. - reload nginx
  50. - name: Enable openstack-slushee site
  51. file:
  52. src: "/etc/nginx/sites-available/openstack-slushee.vhost"
  53. dest: "/etc/nginx/sites-enabled/openstack-slushee.vhost"
  54. state: "link"
  55. notify:
  56. - reload nginx
  57. - name: Place git daemon systemd init script
  58. template:
  59. src: "{{ item.src }}"
  60. dest: "{{ item.dest }}"
  61. mode: "0644"
  62. owner: "root"
  63. group: "root"
  64. with_items:
  65. - src: "git.service.j2"
  66. dest: "{{ systemd_utils_prefix }}/system/git@.service"
  67. - src: "git.socket.j2"
  68. dest: "{{ systemd_utils_prefix }}/system/git.socket"
  69. notify:
  70. - reload git socket
  71. - name: Place the pypiserver systemd init script
  72. config_template:
  73. src: "pypiserver-systemd-init.j2"
  74. dest: "/etc/systemd/system/pypiserver.service"
  75. mode: "0644"
  76. owner: "root"
  77. group: "root"
  78. config_overrides: "{{ repo_pypiserver_init_overrides }}"
  79. config_type: "ini"
  80. notify:
  81. - reload pypiserver