Browse Source
* use appropriate php version both for php and apache installations
* use appropriate php version both for php and apache installations
+ pma for apache with auth and hand made change granted permissions + wp-cli + www-domain alias for apache and revers redirect for thatmaster
dimti
8 months ago
12 changed files with 109 additions and 52 deletions
-
8playbooks/apache-site.yml
-
68playbooks/debops/apache.yml
-
4playbooks/debops/nginx.yml
-
6playbooks/own/apt-update.yml
-
26playbooks/own/phpmyadmin-apache-auth.yml
-
6playbooks/own/phpmyadmin.yml
-
15playbooks/own/wp-cli.yml
-
2run-playbook.sh
-
12run-site-playbook.sh
-
8vars/apache-example.yml
-
4vars/nginx-example.yml
-
2vars/site-example.yml
@ -0,0 +1,6 @@ |
|||
--- |
|||
- name: Update system packages |
|||
hosts: [ 'debian10' ] |
|||
tasks: |
|||
- name: apt update |
|||
shell: apt update && apt upgrade -y |
@ -0,0 +1,26 @@ |
|||
--- |
|||
|
|||
- name: Create phpmyadmin apache auth passwords file |
|||
collections: [ 'debops.debops', 'debops.roles01', |
|||
'debops.roles02', 'debops.roles03' ] |
|||
hosts: [ 'debian10' ] |
|||
tasks: |
|||
- name: Import DebOps secret role |
|||
ansible.builtin.import_role: |
|||
name: 'secret' |
|||
|
|||
- shell: |- |
|||
cd /etc/apache2 |
|||
mkdir -p passwords.d |
|||
|
|||
- name: 'Adding pma apache auth passwords files' |
|||
shell: |- |
|||
echo "{{ site_name }}:$(openssl passwd -apr1 {{ lookup("password", secret + "/basic/" + site_name + "/pma " + "length=30")}} )" > /etc/apache2/passwords.d/pma.passwords |
|||
|
|||
- name: 'Change require all granted rule, because debops not present appropriate functional' |
|||
shell: |- |
|||
sed -i "s|Require all granted|Require valid-user|g" /etc/apache2/sites-available/pma.conf |
|||
|
|||
- name: 'Restarting apache' |
|||
shell: |- |
|||
systemctl restart apache2 |
@ -0,0 +1,15 @@ |
|||
--- |
|||
|
|||
- name: Install WP-CLI |
|||
|
|||
collections: [ 'debops.debops', 'debops.roles01', |
|||
'debops.roles02', 'debops.roles03' ] |
|||
|
|||
hosts: [ 'debian10' ] |
|||
|
|||
tasks: |
|||
- name: Download and install wp-cli |
|||
shell: |- |
|||
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar |
|||
chmod +x wp-cli.phar |
|||
mv wp-cli.phar /usr/local/bin/wp |
@ -0,0 +1,8 @@ |
|||
apache__dependent_vhosts: |
|||
- name: 'pma.{{ apache__default_vhost_name[0] }}' |
|||
filename: 'pma' |
|||
root: '/var/www/phpmyadmin' |
|||
root_directives: |- |
|||
AuthType Basic |
|||
AuthName "Authorization" |
|||
AuthUserFile passwords.d/pma.passwords |
@ -1,2 +1,2 @@ |
|||
nginx_www_domain: True |
|||
nginx_www_redirect: www |
|||
nginx_www_domain: {{ has_www_domain }} |
|||
nginx_www_redirect: {{ www_domain_is_primary | ternary('www', 'non-www') }} |
@ -0,0 +1,2 @@ |
|||
has_www_domain: True |
|||
www_domain_is_primary: False |
Write
Preview
Loading…
Cancel
Save
Reference in new issue