mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-03 19:58:14 +00:00 
			
		
		
		
	Solved 'capplications' typo bug
This commit is contained in:
		@@ -10,7 +10,7 @@
 | 
			
		||||
    name: docker-compose
 | 
			
		||||
 | 
			
		||||
# The following env file will just be used from the dedicated mariadb container
 | 
			
		||||
# and not the {{capplications.mariadb.hostname }}-database
 | 
			
		||||
# and not the {{applications.mariadb.hostname }}-database
 | 
			
		||||
- name: "Create {{database_env}}"
 | 
			
		||||
  template: 
 | 
			
		||||
    src: "env/{{database_type}}.env.j2"
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ The following environment variables need to be defined for successful operation:
 | 
			
		||||
 | 
			
		||||
To completely reset Friendica, including its database and volumes, run:
 | 
			
		||||
```bash
 | 
			
		||||
docker exec -i {{capplications.mariadb.hostname }} mariadb -u root -p"${DB_ROOT_PASSWORD}" -e "DROP DATABASE IF EXISTS friendica; CREATE DATABASE friendica;"
 | 
			
		||||
docker exec -i {{applications.mariadb.hostname }} mariadb -u root -p"${DB_ROOT_PASSWORD}" -e "DROP DATABASE IF EXISTS friendica; CREATE DATABASE friendica;"
 | 
			
		||||
docker compose down
 | 
			
		||||
rm -rv /mnt/hdd/data/docker/volumes/friendica_data
 | 
			
		||||
docker volume rm friendica_data
 | 
			
		||||
@@ -19,7 +19,7 @@ docker volume rm friendica_data
 | 
			
		||||
## Manual Method:
 | 
			
		||||
1. Connect to the MariaDB instance:
 | 
			
		||||
   ```bash
 | 
			
		||||
   docker exec -it {{capplications.mariadb.hostname }} mariadb -u root -p
 | 
			
		||||
   docker exec -it {{applications.mariadb.hostname }} mariadb -u root -p
 | 
			
		||||
   ```
 | 
			
		||||
2. Run the following commands:
 | 
			
		||||
   ```sql
 | 
			
		||||
@@ -31,7 +31,7 @@ docker volume rm friendica_data
 | 
			
		||||
## Automatic Method:
 | 
			
		||||
```bash
 | 
			
		||||
DB_ROOT_PASSWORD="your_root_password"
 | 
			
		||||
docker exec -i {{capplications.mariadb.hostname }} mariadb -u root -p"${DB_ROOT_PASSWORD}" -e "DROP DATABASE IF EXISTS friendica; CREATE DATABASE friendica;"
 | 
			
		||||
docker exec -i {{applications.mariadb.hostname }} mariadb -u root -p"${DB_ROOT_PASSWORD}" -e "DROP DATABASE IF EXISTS friendica; CREATE DATABASE friendica;"
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Enter the Application Container 🔍
 | 
			
		||||
 
 | 
			
		||||
@@ -2,5 +2,5 @@
 | 
			
		||||
 | 
			
		||||
## Execute SQL commands
 | 
			
		||||
```bash
 | 
			
		||||
docker exec -it {{capplications.mariadb.hostname }} mariadb -u root -p
 | 
			
		||||
docker exec -it {{applications.mariadb.hostname }} mariadb -u root -p
 | 
			
		||||
```
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
 | 
			
		||||
- name: install MariaDB
 | 
			
		||||
  docker_container:
 | 
			
		||||
    name: "{{capplications.mariadb.hostname }}"
 | 
			
		||||
    name: "{{applications.mariadb.hostname }}"
 | 
			
		||||
    image: "mariadb:{{applications.mariadb.version}}" #could lead to problems with nextcloud
 | 
			
		||||
    detach: yes
 | 
			
		||||
    env:
 | 
			
		||||
@@ -38,7 +38,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Wait until the MariaDB container is healthy
 | 
			
		||||
  community.docker.docker_container_info:
 | 
			
		||||
    name: "{{capplications.mariadb.hostname }}"
 | 
			
		||||
    name: "{{applications.mariadb.hostname }}"
 | 
			
		||||
  register: db_info
 | 
			
		||||
  until: db_info.containers[0].State.Health.Status == "healthy"
 | 
			
		||||
  retries: 30
 | 
			
		||||
@@ -71,7 +71,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Grant database privileges
 | 
			
		||||
  ansible.builtin.shell:
 | 
			
		||||
    cmd: "docker exec {{capplications.mariadb.hostname }} mariadb -u root -p{{ applications.mariadb.credentials.root_password }} -e \"GRANT ALL PRIVILEGES ON {{database_name}}.* TO '{{database_username}}'@'%';\""
 | 
			
		||||
    cmd: "docker exec {{applications.mariadb.hostname }} mariadb -u root -p{{ applications.mariadb.credentials.root_password }} -e \"GRANT ALL PRIVILEGES ON {{database_name}}.* TO '{{database_username}}'@'%';\""
 | 
			
		||||
  args:
 | 
			
		||||
    executable: /bin/bash
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user