Bug fixes after testing
This commit is contained in:
parent
5ff2c19628
commit
314c2a1527
@ -1,2 +1,2 @@
|
|||||||
[main]
|
[main]
|
||||||
xyz.com ansible_connection=ssh ansible_ssh_port=22 ansible_ssh_user=user
|
xyz.com ansible_connection=ssh ansible_ssh_port=22 ansible_ssh_user=test ansible_sudo_pass=test ansible_ssh_private_key_file=/tmp/test.key
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
file:
|
file:
|
||||||
src: /etc/nginx/sites-available/web-{{ vhost_name }}.conf
|
src: /etc/nginx/sites-available/web-{{ vhost_name }}.conf
|
||||||
dest: /etc/nginx/sites-enabled/web-{{ vhost_name }}.conf
|
dest: /etc/nginx/sites-enabled/web-{{ vhost_name }}.conf
|
||||||
|
state: link
|
||||||
|
|
||||||
- name: Restart Nginx
|
- name: Restart Nginx
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -13,13 +13,17 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: '0744'
|
mode: '0744'
|
||||||
|
|
||||||
- name: Get keyring
|
- name: Add GPG keyring
|
||||||
become: true
|
become: true
|
||||||
shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
apt_key:
|
||||||
|
url: https://download.docker.com/linux/ubuntu/gpg
|
||||||
- name: Add repository
|
state: present
|
||||||
|
|
||||||
|
- name: Add Docker repo
|
||||||
become: true
|
become: true
|
||||||
shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-pluginsudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-pluginlinux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
apt_repository:
|
||||||
|
repo: deb https://download.docker.com/linux/ubuntu focal stable
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Update repository and install docker
|
- name: Update repository and install docker
|
||||||
apt:
|
apt:
|
||||||
@ -28,4 +32,10 @@
|
|||||||
- docker-ce-cli
|
- docker-ce-cli
|
||||||
- containerd.io
|
- containerd.io
|
||||||
- docker-compose-plugin
|
- docker-compose-plugin
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Install Docker compose
|
||||||
|
get_url:
|
||||||
|
url: https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64
|
||||||
|
dest: /usr/local/bin/docker-compose
|
||||||
|
mode: 'u+x,g+x'
|
@ -1,4 +1,10 @@
|
|||||||
---
|
---
|
||||||
|
- name: Failsafe - disable Apache if exists
|
||||||
|
systemd:
|
||||||
|
name: apache2
|
||||||
|
state: stopped
|
||||||
|
enabled: no
|
||||||
|
|
||||||
- name: Install Nginx
|
- name: Install Nginx
|
||||||
apt:
|
apt:
|
||||||
pkg:
|
pkg:
|
||||||
|
@ -2,23 +2,38 @@
|
|||||||
- name: Download latest WP
|
- name: Download latest WP
|
||||||
get_url:
|
get_url:
|
||||||
url: https://wordpress.org/latest.zip
|
url: https://wordpress.org/latest.zip
|
||||||
dest: /var/www/{{ vhost_name }}
|
dest: /tmp/latest.zip
|
||||||
mode: '0660'
|
mode: '0660'
|
||||||
|
|
||||||
- name: Extract wordpress
|
- name: Extract wordpress
|
||||||
unarchive:
|
unarchive:
|
||||||
src: /var/www/{{ vhost_name }}/latest.zip
|
src: /tmp/latest.zip
|
||||||
dest: /var/www/{{ vhost_name }}
|
dest: /var/www/
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
|
||||||
- name: Delete the wordpress zip
|
- name: Delete the wordpress zip
|
||||||
file:
|
file:
|
||||||
state: absent
|
state: absent
|
||||||
path: /var/www/{{ vhost_name }}/latest.zip
|
path: /tmp/latest.zip
|
||||||
|
|
||||||
- name: Setup permissions
|
- name: Create wwwroot
|
||||||
file:
|
file:
|
||||||
path: /var/www/{{ vhost_name }}
|
path: /var/www/{{ vhost_name}}
|
||||||
owner: www-data
|
state: directory
|
||||||
group: www-data
|
mode: '0755'
|
||||||
mode: '0644'
|
|
||||||
|
- name: Rename folder
|
||||||
|
shell: mv /var/www/wordpress/* /var/www/{{ vhost_name }}/
|
||||||
|
|
||||||
|
- name: Delete old folder
|
||||||
|
file:
|
||||||
|
path: /var/www/wordpress
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Chown
|
||||||
|
become: true
|
||||||
|
shell: chown -R www-data:www-data /var/www/{{ vhost_name }}
|
||||||
|
|
||||||
|
- name: Chmod
|
||||||
|
become: true
|
||||||
|
shell: chmod -R 755 /var/www/{{ vhost_name }}
|
||||||
|
@ -20,7 +20,13 @@
|
|||||||
- name: Copy MySQL compose file
|
- name: Copy MySQL compose file
|
||||||
template:
|
template:
|
||||||
src: files/mysql.j2
|
src: files/mysql.j2
|
||||||
dest: /opt/docker/compose-files/mysql/docker-compose.yaml
|
dest: /opt/docker/compose-files/mysql/docker-compose.yml
|
||||||
|
|
||||||
|
- name: Rise MySQL container
|
||||||
|
become: true
|
||||||
|
shell: docker-compose up -d
|
||||||
|
args:
|
||||||
|
chdir: /opt/docker/compose-files/mysql
|
||||||
|
|
||||||
- name: Create Redis dirs
|
- name: Create Redis dirs
|
||||||
file:
|
file:
|
||||||
@ -28,7 +34,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Create Redisdirs
|
- name: Create Redis dirs
|
||||||
file:
|
file:
|
||||||
path: /opt/docker/redis
|
path: /opt/docker/redis
|
||||||
state: directory
|
state: directory
|
||||||
@ -37,4 +43,10 @@
|
|||||||
- name: Copy Redis compose file
|
- name: Copy Redis compose file
|
||||||
template:
|
template:
|
||||||
src: files/redis.j2
|
src: files/redis.j2
|
||||||
dest: /opt/docker/compose-files/redis/docker-compose.yml
|
dest: /opt/docker/compose-files/redis/docker-compose.yml
|
||||||
|
|
||||||
|
- name: Rise Redis container
|
||||||
|
become: true
|
||||||
|
shell: docker-compose up -d
|
||||||
|
args:
|
||||||
|
chdir: /opt/docker/compose-files/redis
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
vars_files:
|
vars_files:
|
||||||
- /vars/external.yml
|
- vars/external.yml
|
||||||
become: yes
|
become: yes
|
||||||
become_user: root
|
become_user: root
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
@ -13,4 +13,4 @@
|
|||||||
- role: configure-php
|
- role: configure-php
|
||||||
- role: install-wordpress
|
- role: install-wordpress
|
||||||
- role: install-docker
|
- role: install-docker
|
||||||
- role: setup-containers
|
- role: setup-containers
|
||||||
|
Loading…
Reference in New Issue
Block a user