Skip to content

Commit

Permalink
Merge branch 'custom_config' of https://github.com/InstruktoriBrno/an…
Browse files Browse the repository at this point in the history
…sible-apache2 into InstruktoriBrno-custom_config
  • Loading branch information
franklinkim committed Nov 6, 2020
2 parents 467dbc9 + 0dde125 commit 9999bf6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Here is a list of all the default variables for this role, which are also availa
# apache2_confs:
# - { id: security, state: absent }
# - { name: mime, state: present }
# - id: my_config
# state: present
# template: path/to/template.j2
# apache2_sites:
# - id: mysite (required)
# name: mysite.local (required)
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# apache2_confs:
# - { id: security, state: absent }
# - { name: mime, state: present }
# - id: my_config
# state: present
# template: path/to/template.j2
# apache2_sites:
# - id: mysite (required)
# name: mysite.local (required)
Expand Down
11 changes: 11 additions & 0 deletions tasks/manage_confs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
---

- name: Creating confs
template:
src: "{{ item.template }}"
dest: "/etc/apache2/conf-available/{{ item.id }}.conf"
owner: root
group: root
mode: "0644"
when: item.template is defined
with_items: "{{ apache2_confs }}"
notify: reload apache2

- name: Enabling conf
command: >
a2enconf {{ item.id }}
Expand Down

0 comments on commit 9999bf6

Please sign in to comment.