Deploy a local website to each machine

I guess
This commit is contained in:
Salt 2020-07-12 10:01:57 -05:00
parent c6a82c0d4e
commit 00ffbed6d2
5 changed files with 42 additions and 1 deletions

View File

@ -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"

View File

@ -1,2 +1,4 @@
---
allow_duplicates: no
dependencies:
- role: apache-php

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,8 @@
# Configuration for {{ inventory_hostname }} local Apache
# vim:ft=apache:
# Website configuration
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/var/www/localhost"
</VirtualHost>