CentOS.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. when: not debug_speed_check
  22. - name: Prep OS... import key from Collabora centos{{ ansible_distribution_major_version|int }} repo
  23. ansible.builtin.rpm_key:
  24. state: present
  25. key: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-centos{{ ansible_distribution_major_version|int }}/repodata/repomd.xml.key
  26. when: nc_collabora
  27. - name: Prep OS... add Collabora repos centos{{ ansible_distribution_major_version|int }} repo
  28. ansible.builtin.yum_repository:
  29. name: collabora
  30. description: Collabora Online CODE repo
  31. baseurl: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-centos{{ ansible_distribution_major_version|int }}
  32. when: nc_collabora
  33. - name: Prep OS... install Collabora packages
  34. dnf:
  35. name:
  36. - coolwsd
  37. - CODE-brand
  38. - inotify-tools
  39. - psmisc
  40. - perl
  41. state: latest
  42. when: nc_collabora
  43. - name: Prep OS... update os
  44. dnf:
  45. name: '*'
  46. update_cache: true
  47. state: latest
  48. when: not debug_speed_check
  49. - name: Prep OS... install needed packages
  50. dnf:
  51. name:
  52. - libreoffice
  53. - ffmpeg
  54. - mariadb
  55. state: latest
  56. enablerepo: epel
  57. when: not debug_speed_check
  58. - name: Prep OS... Ensure Apache is installed on {{ ansible_facts['distribution'] }}
  59. dnf:
  60. name: httpd
  61. state: present
  62. when: nextcloud_websrv in ["apache", "apache2"]
  63. - name: Prep OS... Set http env on {{ ansible_facts['distribution'] }}
  64. set_fact:
  65. http_service_name: httpd
  66. http_webroot: /var/www/html
  67. nextcloud_websrv_user: apache
  68. nextcloud_websrv_group: apache
  69. when: nextcloud_websrv in ["apache", "apache2"]
  70. - name: Prep OS... Generate Nextcloud configuration for apache
  71. template:
  72. dest: /etc/httpd/conf.d/nextcloud.conf
  73. src: nextcloud_apache2.j2
  74. mode: 0640
  75. when: nextcloud_websrv in ["apache", "apache2"]
  76. - name: Prep OS... Allow http to listen on tcp port 8000
  77. seport:
  78. ports: 8000
  79. proto: tcp
  80. setype: http_port_t
  81. state: present
  82. #- name: Prep OS... semanage port
  83. # command: semanage port -m -t http_port_t -p tcp {{ item }}
  84. # loop:
  85. # - "8000"
  86. - name: Prep OS... Start {{ http_service_name }} service
  87. service:
  88. name: "{{ http_service_name }}"
  89. state: started