diff --git a/inventory/group_vars/home.yml b/inventory/group_vars/home.yml index bf5d528..0a43765 100644 --- a/inventory/group_vars/home.yml +++ b/inventory/group_vars/home.yml @@ -1,5 +1,6 @@ #!/usr/bin/ansible-playbook # vim:ft=ansible: ansible_pull_frequency: 8h -backups_frequency: 1d aws_backup_bucket: "9iron-backups-home" +backups_frequency: 1d +desktop_web_repo: "https://git.9iron.club/salt/www" diff --git a/roles/desktop/meta/main.yml b/roles/desktop/meta/main.yml index d098f75..7e415bc 100644 --- a/roles/desktop/meta/main.yml +++ b/roles/desktop/meta/main.yml @@ -1,2 +1,4 @@ --- allow_duplicates: no +dependencies: + - role: apache-php diff --git a/roles/desktop/tasks/apache.yml b/roles/desktop/tasks/apache.yml new file mode 100644 index 0000000..4fcc8d1 --- /dev/null +++ b/roles/desktop/tasks/apache.yml @@ -0,0 +1,28 @@ +#!/usr/bin/ansible-playbook +# vim:ft=ansible: +--- +- name: Set up local Apache + block: + - name: Set up Apache + block: + - name: Create webroot + file: + path: "/var/www/localhost" + mode: "0755" + state: directory + - name: Clone repo + git: + repo: "{{ desktop_web_repo }}" + dest: "/var/www/localhost" + notify: restart apache + - name: Copy over virtual host configs + template: + src: apache2-vhost.conf + dest: "/etc/apache2/sites-available/localhost.conf" + notify: restart apache + - name: Enable config + command: + cmd: "a2ensite localhost.conf" + creates: "/etc/apache2/sites-enabled/localhost.conf" + notify: restart apache + become: yes diff --git a/roles/desktop/tasks/main.yml b/roles/desktop/tasks/main.yml index 767a860..79f5a7f 100644 --- a/roles/desktop/tasks/main.yml +++ b/roles/desktop/tasks/main.yml @@ -38,6 +38,8 @@ - { src: "g810-led.rules", dest: "/etc/udev/rules.d/50-g810-led.rules", mode: "0644" } - { src: "switch-rcm.rules", dest: "/etc/udev/rules.d/50-switch-rcm.rules", mode: "0644" } notify: reload udev + - name: Configure local Apache + include_tasks: apache.yml - name: Configure SSH include_tasks: sshd.yml - name: Configure system packages diff --git a/roles/desktop/templates/apache2-vhost.conf b/roles/desktop/templates/apache2-vhost.conf new file mode 100644 index 0000000..ad0301b --- /dev/null +++ b/roles/desktop/templates/apache2-vhost.conf @@ -0,0 +1,8 @@ +# Configuration for {{ inventory_hostname }} local Apache +# vim:ft=apache: + +# Website configuration + + ServerName localhost + DocumentRoot "/var/www/localhost" +