I have a playbook that creates a directory, creates content on index.html, and a link from /web_hosting to /var/www/html.
The directory is called /web_hosting the content is /web_hosting/index.html I do not want to change the httpd.conf default web directory to /web_hosting I just want to use a link.
After running the play when I curl the server I'm not seeing the content from the index.html file. Can someone help me with my play?
- name: setup webserver and link to folder
hosts: prod
tasks:
- name: create dir file: path: /web_hosting state: directory setype: httpd_sys_content_t mode: 0775
- name: install yum: name: httpd state: present
- name: configure service service: name: httpd state: started enabled: true
- name: create content on index.html copy: dest: /web_hosting/index.html content: "hello from {{ansible_hostname}}"
- name: create link file: src: /web_hosting dest: /var/www/html state: link