mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Update main.yml
This commit is contained in:
parent
379102824c
commit
e101d2f42c
1 changed files with 126 additions and 128 deletions
|
@ -1,8 +1,6 @@
|
||||||
- name: Install MySQL (debuntu)
|
- name: Install MySQL (debuntu)
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name:
|
||||||
state: present
|
|
||||||
with_items:
|
|
||||||
- mariadb-server
|
- mariadb-server
|
||||||
- mariadb-client
|
- mariadb-client
|
||||||
- python-mysqldb
|
- python-mysqldb
|
||||||
|
@ -13,29 +11,28 @@
|
||||||
- php{{ php_version }}-imap
|
- php{{ php_version }}-imap
|
||||||
- php{{ php_version }}-ldap
|
- php{{ php_version }}-ldap
|
||||||
- php{{ php_version }}-odbc
|
- php{{ php_version }}-odbc
|
||||||
# - php{{ php_version }}-xml
|
#- php{{ php_version }}-xml
|
||||||
- php{{ php_version }}-xmlrpc
|
- php{{ php_version }}-xmlrpc
|
||||||
|
state: present
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
|
||||||
- name: php-xml (ubuntu or debian-9)
|
- name: php-xml (ubuntu or debian-9)
|
||||||
package:
|
package:
|
||||||
name: "php{{ php_version }}-xml"
|
name: "php{{ php_version }}-xml"
|
||||||
state: present
|
state: present
|
||||||
when: is_ubuntu or is_debian_9
|
when: is_ubuntu or is_debian_9
|
||||||
|
|
||||||
- name: php-xml (debian-8)
|
- name: php-xml (debian-8)
|
||||||
package:
|
package:
|
||||||
name: "php-xml-parser"
|
name: "php-xml-parser"
|
||||||
state: present
|
state: present
|
||||||
when: is_debian_8
|
when: is_debian_8
|
||||||
|
|
||||||
- name: Install MySQL (OS's other than debuntu)
|
- name: Install MySQL (OS's other than debuntu)
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name:
|
||||||
state: present
|
|
||||||
with_items:
|
|
||||||
- MySQL-python
|
- MySQL-python
|
||||||
- mysql
|
- mysql
|
||||||
- php
|
- php
|
||||||
|
@ -47,27 +44,28 @@
|
||||||
- php-odbc
|
- php-odbc
|
||||||
- php-xml
|
- php-xml
|
||||||
- php-xmlrpc
|
- php-xmlrpc
|
||||||
|
state: present
|
||||||
when: not is_debuntu
|
when: not is_debuntu
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
|
||||||
- include_tasks: centos.yml
|
- include_tasks: centos.yml
|
||||||
when: ansible_distribution == "CentOS"
|
when: ansible_distribution == "CentOS"
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
|
||||||
- include_tasks: fedora.yml
|
- include_tasks: fedora.yml
|
||||||
when: ansible_distribution == "Fedora"
|
when: ansible_distribution == "Fedora"
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
|
||||||
# Name of mysql service varies by OS so softcoded in 1-prep
|
# Name of mysql service varies by OS so softcoded in 1-prep
|
||||||
- name: Start the MySQL service
|
- name: Start the MySQL service
|
||||||
service:
|
service:
|
||||||
name: "{{ mysql_service }}"
|
name: "{{ mysql_service }}"
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Enable the MySQL service
|
- name: Enable the MySQL service
|
||||||
service:
|
service:
|
||||||
name: "{{ mysql_service }}"
|
name: "{{ mysql_service }}"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
@ -76,7 +74,7 @@
|
||||||
# 'localhost' needs to be the last item for idempotency, see
|
# 'localhost' needs to be the last item for idempotency, see
|
||||||
# http://ansible.cc/docs/modules.html#mysql-user
|
# http://ansible.cc/docs/modules.html#mysql-user
|
||||||
# unfortunately it still doesn't work
|
# unfortunately it still doesn't work
|
||||||
- name: Update MySQL root password for localhost root accounts
|
- name: Update MySQL root password for localhost root accounts
|
||||||
mysql_user:
|
mysql_user:
|
||||||
name: root
|
name: root
|
||||||
host: "{{ item }}"
|
host: "{{ item }}"
|
||||||
|
@ -86,7 +84,7 @@
|
||||||
- localhost
|
- localhost
|
||||||
when: mysql_enabled
|
when: mysql_enabled
|
||||||
|
|
||||||
- name: Copy .my.cnf file with root password credentials
|
- name: Install .my.cnf file from template, with root password credentials
|
||||||
template:
|
template:
|
||||||
src: my.cnf.j2
|
src: my.cnf.j2
|
||||||
dest: /root/.my.cnf
|
dest: /root/.my.cnf
|
||||||
|
@ -94,46 +92,46 @@
|
||||||
mode: 0600
|
mode: 0600
|
||||||
when: mysql_enabled
|
when: mysql_enabled
|
||||||
|
|
||||||
- name: Update MySQL root password for all remaining root accounts
|
- name: Update MySQL root password for all remaining root accounts
|
||||||
mysql_user:
|
mysql_user:
|
||||||
name: root
|
name: root
|
||||||
host: "{{ item }}"
|
host: "{{ item }}"
|
||||||
password: "{{ mysql_root_password }}"
|
password: "{{ mysql_root_password }}"
|
||||||
priv: "*.*:ALL,GRANT"
|
priv: "*.*:ALL,GRANT"
|
||||||
with_items:
|
with_items:
|
||||||
# - "{{ iiab_hostname }}.{{ iiab_domain }}"
|
#- "{{ iiab_hostname }}.{{ iiab_domain }}"
|
||||||
- 127.0.0.1
|
- 127.0.0.1
|
||||||
- ::1
|
- ::1
|
||||||
when: mysql_enabled
|
when: mysql_enabled
|
||||||
|
|
||||||
- name: Delete anonymous MySQL server user for {{ ansible_hostname }}
|
- name: Delete anonymous MySQL server user for {{ ansible_hostname }}
|
||||||
mysql_user:
|
mysql_user:
|
||||||
user: ""
|
user: ""
|
||||||
host: "{{ ansible_hostname }}"
|
host: "{{ ansible_hostname }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: mysql_enabled
|
when: mysql_enabled
|
||||||
|
|
||||||
- name: Delete anonymous MySQL server user for localhost
|
- name: Delete anonymous MySQL server user for localhost
|
||||||
mysql_user:
|
mysql_user:
|
||||||
user: ""
|
user: ""
|
||||||
state: absent
|
state: absent
|
||||||
when: mysql_enabled
|
when: mysql_enabled
|
||||||
|
|
||||||
- name: Remove the MySQL test database
|
- name: Remove the MySQL test database
|
||||||
mysql_db:
|
mysql_db:
|
||||||
db: test
|
db: test
|
||||||
state: absent
|
state: absent
|
||||||
when: mysql_enabled
|
when: mysql_enabled
|
||||||
|
|
||||||
# we had to start mysql in order to configure it, now turn if off if not enabled
|
# we had to start mysql in order to configure it, now turn if off if not enabled
|
||||||
- name: Provisionally Disable the MySQL service
|
- name: Provisionally Disable the MySQL service
|
||||||
service:
|
service:
|
||||||
name: "{{ mysql_service }}"
|
name: "{{ mysql_service }}"
|
||||||
enabled: no
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not mysql_enabled
|
when: not mysql_enabled
|
||||||
|
|
||||||
- name: Add 'mysql' to list of services at {{ iiab_ini_file }}
|
- name: Add 'mysql' to list of services at {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
dest: "{{ iiab_ini_file }}"
|
dest: "{{ iiab_ini_file }}"
|
||||||
section: mysql
|
section: mysql
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue