first commit
0 parents
Showing
2 changed files
with
55 additions
and
0 deletions
main.yml
0 → 100644
| 1 | --- | ||
| 2 | - name: Configure a simple repo with apache | ||
| 3 | hosts: "{{ server | default('jb_1') }}" # servidor a ser utilizado como repo | ||
| 4 | become: true | ||
| 5 | tasks: | ||
| 6 | - name: install apache | ||
| 7 | yum: | ||
| 8 | name: httpd | ||
| 9 | state: present | ||
| 10 | tags: | ||
| 11 | - install_apache | ||
| 12 | |||
| 13 | - name: copy the conf file | ||
| 14 | template: | ||
| 15 | src: templates/repo.conf | ||
| 16 | dest: /etc/httpd/conf.d/repo.conf | ||
| 17 | notify: restart httpd | ||
| 18 | tags: | ||
| 19 | - copy_the_conf_file | ||
| 20 | |||
| 21 | - name: check firewalld is up | ||
| 22 | service: | ||
| 23 | name: firewalld | ||
| 24 | state: started | ||
| 25 | tags: | ||
| 26 | - check_firewalld_is_up | ||
| 27 | |||
| 28 | - name: add http service to the firewalld | ||
| 29 | firewalld: | ||
| 30 | service: http | ||
| 31 | permanent: yes | ||
| 32 | state: enabled | ||
| 33 | immediate: yes | ||
| 34 | tags: | ||
| 35 | - add_http_service_to_the_firewalld | ||
| 36 | |||
| 37 | - name: enable the httpd service | ||
| 38 | service: | ||
| 39 | name: httpd | ||
| 40 | state: started | ||
| 41 | enabled: yes | ||
| 42 | |||
| 43 | handlers: | ||
| 44 | - name: restart httpd | ||
| 45 | service: | ||
| 46 | name: httpd | ||
| 47 | state: restarted |
-
Please register or sign in to post a comment