testing playbook. still not working. mysql module is making problems. need better understanding.

This commit is contained in:
CubelaPetar
2024-12-01 12:13:46 +01:00
parent 8eb001f390
commit d2ab787637
7 changed files with 34 additions and 21 deletions

View File

@@ -2,6 +2,7 @@
nocows = 1 nocows = 1
host_key_checking = false host_key_checking = false
inventory = ./hosts.ini inventory = ./hosts.ini
ansible_python_interpreter = /usr/bin/python3
[ssh_connections] [ssh_connections]
pipelining = true pipelining = true

View File

@@ -1,6 +1,6 @@
[snipeit] #[snipeit]
10.0.101.15 ansible_user=root ansible_port=22 #10.0.101.15 ansible_user=root ansible_port=22
#
[sbx-srv-owncloud01] [owncloud]
10.0.101.16 ansible_user=sbxadmin ansible_port=22 10.56.0.99 ansible_user=reliyya ansible_port=22

View File

@@ -5,6 +5,7 @@
name: name:
- python3-apt - python3-apt
- python3-pycurl - python3-pycurl
- python3-pymysql
- name: Add ondrej repository for later versions of PHP. - name: Add ondrej repository for later versions of PHP.
apt_repository: apt_repository:
@@ -51,8 +52,8 @@
- inetutils-ping - inetutils-ping
- ldap-utils - ldap-utils
- name: Disable the firewall (since this is behind a firewall) #- name: Disable the firewall (since this is behind a firewall)
service: name=ufw state=stopped # service: name=ufw state=stopped
- name: "Start Apache, MySQL, and PHP." - name: "Start Apache, MySQL, and PHP."
service: "name={{ item }} state=started enabled=yes" service: "name={{ item }} state=started enabled=yes"

View File

@@ -1,7 +1,16 @@
- name: Create a MySQL database for ownCloud. - name: Create a MySQL database for ownCloud.
mysql_user: community.mysql.mysql_db:
name: owncloud
state: present
login_unix_socket: /run/mysqld/mysqld.sock
- name: Create a MySQL db user for ownCloud.
community.mysql.mysql_user:
name: "owncloud" name: "owncloud"
password: "{{ mysql_passwd }}" password: "{{ mysql_passwd }}"
login_user: "root"
login_password: "{{ mysql_passwd }}"
priv: "owncloud.*:ALL" priv: "owncloud.*:ALL"
host: localhost host: localhost
state: present state: present
login_unix_socket: /run/mysqld/mysqld.sock

View File

@@ -3,6 +3,7 @@
ansible.builtin.get_url: ansible.builtin.get_url:
url: https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2 url: https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2
dest: "/tmp/owncloud-complete-latest.tar.bz2" dest: "/tmp/owncloud-complete-latest.tar.bz2"
owner: www-data
- name: Extract the archive. - name: Extract the archive.
ansible.builtin.unarchive: ansible.builtin.unarchive:

View File

@@ -16,7 +16,7 @@
# - role: ironicbadger.docker_compose_generator # - role: ironicbadger.docker_compose_generator
# #
- hosts: sbx-srv-owncloud01 - hosts: owncloud
become: yes become: yes
vars_files: vars_files:
- "vars/vault.yml" - "vars/vault.yml"

View File

@@ -1,13 +1,14 @@
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
61653539633662393863626638666466303131396237373661303939333263303033653638343235 64313562613766336237383361623333393830336465653361646334323034643831393230393737
6437663430656538303865336663616432313832333532380a323632633339616466313038356239 6538353232666230373434626365373632366265346230340a643739373735643232376564323335
64623565623264303739633134656666363163613361306230343638346330383435623931373364 38613365393833316661643332303965653530393834653062636665613835353565643232373432
3463643433323631650a613233353266333036643239366330613133643238626132336530653462 3434333936396637340a613163333161393239636435633761316639666531633065323761333263
37643966643663313964373531373731343064613461636564656332336461326235666264643030 62323930333162323137643939616266326333613034303339653762663566323862356136393665
37663966626561343761623363346539333662613966366564323639306230626265343431366238 63653335396434613738626164653437613639336436613362666434343565343866336237633561
63353531313165633365323439643033313536306330656332373162373733616338613561383233 36356139363939323635643862333730633638633139653364363435393761653131636635383765
33376530636530376638383562373862633362366366333130633833633938613462613932313834 61663933376333663262373739643337336232323166306239616564363931366535626638626534
61353563356361363338356665363364366166346534346137323661363464653934363638303766 66376436323735373634333164653437393830386333303034326461383062653930366437636234
39633963626231373138636237326531353835343930643535313937656334613462626639326139 38626632653236346233636163646435313034656534623134626366663466636335313236323837
61326665643862326365356165393361326266616530306330643665386663356536646337343061 35636531616531663663393636663735643236323234633833386463666131333036343562646539
37353230653062616266 33343331646463613661316637653236633362393333346535376161626365643433616138663565
3838