Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions vagrant/provisioning/roles/arkcase-portal-ui/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,19 @@
src: "{{ root_folder }}/install/httpd/arkcase-portal{{ arkcase_portal_extension_formatted }}-ui{{ arkcase_portal_ui_version_formatted }}.zip"
dest: "{{ root_folder }}/data/httpd/htdocs/{{ arkcase_portal_context }}/"
when: arkcase_portal_zip is changed

- name: see if arkcase portal UI robots.txt exists
become: yes
become_user: apache
stat:
path: "{{ root_folder }}/data/httpd/htdocs/{{ arkcase_portal_context }}/robots.txt"
register: arkcase_portal_robots_txt

- name: copy robots.txt if it exists
become: yes
become_user: apache
copy:
remote_src: yes
src: "{{ root_folder }}/data/httpd/htdocs/{{ arkcase_portal_context }}/robots.txt"
dest: "{{ root_folder }}/data/httpd/htdocs/robots.txt"
when: arkcase_portal_robots_txt.stat.exists == true
36 changes: 35 additions & 1 deletion vagrant/provisioning/roles/haproxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
ansible.builtin.lineinfile:
backup: true
path: "{{ path_haproxy_cfg }}"
insertafter: "acl acl_arkcase_portal path_beg /{{ arkcase_portal_context | default('portal') }}"
insertbefore: "acl acl_arkcase_portal path_beg /{{ arkcase_portal_context | default('portal') }}"
line: " acl acl_sitemap path_beg /{{ arkcase_portal_context | default('portal') }}/sitemap"
when: enable_sitemap_config | default(false)

Expand Down Expand Up @@ -407,6 +407,40 @@
http-request set-path %[path,regsub(^/{{ arkcase_portal_context | default('portal') }}/,/sitemap/)]
when: enable_sitemap_config | default(false)

### Portal Robots.txt proxy rules
- name: ArkCase Portal Robots.txt setup
become: true
ansible.builtin.lineinfile:
backup: true
path: "{{ path_haproxy_cfg }}"
insertbefore: " acl acl_sitemap path_beg /{{ arkcase_portal_context | default('portal') }}/sitemap"
line: " acl acl_robots path_beg /robots.txt"
when: enable_sitemap_config | default(false)

- name: Tell ArkCase Portal Robots.txt which backend to use
become: true
ansible.builtin.lineinfile:
backup: true
path: "{{ path_haproxy_cfg }}"
insertafter: "# backend uses"
line: " use_backend be_robots if acl_robots"
when: enable_sitemap_config | default(false)

- name: ArkCase Portal Robots.txt context, if needed
become: true
ansible.builtin.blockinfile:
backup: true
marker: "# {mark} ANSIBLE MANAGED BLOCK ARKCASE PORTAL Robots.txt CONTEXT"
insertafter: "#backend servers"
path: "{{ path_haproxy_cfg }}"
block: |
backend be_robots
http-response add-header X-ARKCASE-PORTAL-Node %s
mode http
option tcp-check
server arkcase_portal0 {{ internal_host }}:488 check fall 3 rise 2 check ssl verify required ca-file {{ ssl_ca }}
when: enable_sitemap_config | default(false)

### Showcase frontend
- name: Showcase frontend part
become: true
Expand Down