CentOS.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ---
  2. # CentOS related tasks
  3. #- name: Prep OS... Create tmp directory
  4. # file:
  5. # path: "{{ item }}"
  6. # state: directory
  7. # owner: "{{ ansible_user }}"
  8. # mode: 0770
  9. # with_items:
  10. # - "/tmp/ansible_{{ ansible_user }}"
  11. #
  12. #- name: Prep OS... Set remote tmp
  13. # set_fact:
  14. # ansible_remote_tmp: "/tmp/ansible_{{ ansible_user }}"
  15. - name: Prep OS... add rpmfusion-free-release centos{{ ansible_distribution_major_version|int }} repo
  16. dnf:
  17. name: https://download1.rpmfusion.org/free/el/rpmfusion-free-release-{{ ansible_distribution_major_version|int }}.noarch.rpm
  18. disable_gpg_check: yes
  19. validate_certs: no
  20. state: latest
  21. - name: Prep OS... import key from Collabora centos{{ ansible_distribution_major_version|int }} repo
  22. ansible.builtin.rpm_key:
  23. state: present
  24. key: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-centos{{ ansible_distribution_major_version|int }}/repodata/repomd.xml.key
  25. when: nc_collabora
  26. - name: Prep OS... add Collabora repos centos{{ ansible_distribution_major_version|int }} repo
  27. ansible.builtin.yum_repository:
  28. name: collabora
  29. description: Collabora Online CODE repo
  30. baseurl: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-centos{{ ansible_distribution_major_version|int }}
  31. when: nc_collabora
  32. - name: Prep OS... install Collabora packages
  33. dnf:
  34. name:
  35. - coolwsd
  36. - CODE-brand
  37. - inotify-tools
  38. - psmisc
  39. - perl
  40. state: latest
  41. when: nc_collabora
  42. - name: Prep OS... update os
  43. dnf:
  44. name: '*'
  45. update_cache: true
  46. state: latest
  47. - name: Prep OS... install needed packages
  48. dnf:
  49. name:
  50. - libreoffice
  51. - ffmpeg
  52. - mariadb
  53. state: latest
  54. enablerepo: epel
  55. - name: Prep OS... Ensure Apache is installed on {{ ansible_facts['distribution'] }}
  56. dnf:
  57. name: httpd
  58. state: present
  59. when: nextcloud_websrv in ["apache", "apache2"]
  60. - name: Prep OS... Set http env on {{ ansible_facts['distribution'] }}
  61. set_fact:
  62. http_service_name: httpd
  63. http_webroot: /var/www/html
  64. nextcloud_websrv_user: apache
  65. nextcloud_websrv_group: apache
  66. when: nextcloud_websrv in ["apache", "apache2"]
  67. - name: Prep OS... Generate Nextcloud configuration for apache
  68. template:
  69. dest: /etc/httpd/conf.d/nextcloud.conf
  70. src: nextcloud_apache2.j2
  71. mode: 0640
  72. when: nextcloud_websrv in ["apache", "apache2"]
  73. - name: Prep OS... Allow http to listen on tcp port 8000
  74. seport:
  75. ports: 8000
  76. proto: tcp
  77. setype: http_port_t
  78. state: present
  79. #- name: Prep OS... semanage port
  80. # command: semanage port -m -t http_port_t -p tcp {{ item }}
  81. # loop:
  82. # - "8000"
  83. - name: Prep OS... Start {{ http_service_name }} service
  84. service:
  85. name: "{{ http_service_name }}"
  86. state: started