Skip to content

Instantly share code, notes, and snippets.

@Nothing4You
Created August 2, 2018 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nothing4You/caa7c3df05ff701deeaf0ee0818aa62d to your computer and use it in GitHub Desktop.
Save Nothing4You/caa7c3df05ff701deeaf0ee0818aa62d to your computer and use it in GitHub Desktop.
- name: "Apache: Check if other-vhosts-access-log is enabled"
stat:
path: "/etc/apache2/conf-enabled/other-vhosts-access-log.conf"
register: check_other_vhosts_access_log
- name: "Apache: Disable other-vhosts-access-log"
command: a2disconf other-vhosts-access-log
when: check_other_vhosts_access_log.stat.exists
notify: restart apache service
- name: "Apache: Install apache custom configuration"
template:
src: 'apache2-custom.j2'
dest: "/etc/apache2/conf-available/custom.conf"
mode: 0644
notify: restart apache service
- name: "Apache: Check if custom configuration is enabled"
stat:
path: "/etc/apache2/conf-enabled/custom.conf"
register: check_custom_conf
- name: "Apache: Enable custom configuration"
command: a2enconf custom
when: check_custom_conf.stat.exists == False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment