Changeset - 62adfbb316a3
[Not reviewed]
0 3 0
Branko Majic (branko) - 5 years ago 2021-01-13 22:15:13
branko@majic.rs
MAR-151: Added support for Debian 10 Buster to database_server role:

- Updated role reference documentaiton.
- Updated role meta information.
- Updated tests.
- Deploy MariaDB client login configuration prior to setting-up
users/passwords for deprecated feature testing to avoid errors when
password gets changed in the middle of a task loop.
3 files changed with 23 insertions and 8 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -2033,24 +2033,25 @@ Depends on the following roles:
 
Parameters
 
~~~~~~~~~~
 

	
 
This role has no parameters.
 

	
 

	
 
Distribution compatibility
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
Role is compatible with the following distributions:
 

	
 
- Debian 9 (Stretch)
 
- Debian 10 (Buster)
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
 
This role has no parameters which can be configured configure.
 

	
 

	
 
Database
 
--------
 

	
 
The ``database`` role can be used for creating a MariaDB database and
roles/database_server/molecule/default/molecule.yml
Show inline comments
 
@@ -19,24 +19,38 @@ platforms:
 
      - parameters-mandatory
 
    box: debian/contrib-stretch64
 
    memory: 512
 
    cpus: 1
 

	
 
  - name: deprecated-stretch64
 
    groups:
 
      - deprecated
 
    box: debian/contrib-stretch64
 
    memory: 512
 
    cpus: 1
 

	
 
  - name: parameters-mandatory-buster64
 
    groups:
 
      - parameters-mandatory
 
    box: debian/contrib-buster64
 
    memory: 512
 
    cpus: 1
 

	
 
  - name: deprecated-buster64
 
    groups:
 
      - deprecated
 
    box: debian/contrib-buster64
 
    memory: 512
 
    cpus: 1
 

	
 
provisioner:
 
  name: ansible
 
  config_options:
 
    defaults:
 
      force_valid_group_names: "ignore"
 
      interpreter_python: "/usr/bin/python3"
 
    ssh_connection:
 
      pipelining: "True"
 
  lint:
 
    name: ansible-lint
 

	
 
scenario:
roles/database_server/molecule/default/prepare.yml
Show inline comments
 
@@ -27,44 +27,44 @@
 
        name:
 
          - mariadb-client
 
          - mariadb-server
 
          - python3-mysqldb
 
        state: present
 

	
 
    - name: Enable and start MariaDB
 
      service:
 
        name: mysql
 
        state: started
 
        enabled: true
 

	
 
    - name: Deploy username and password for the root database user
 
      copy:
 
        src: "deprecated-root-my.cnf"
 
        dest: "/root/.my.cnf"
 
        owner: root
 
        group: root
 
        mode: 0400
 

	
 
    - name: Set password for the root database user (creating separate entry for different hosts)
 
      mysql_user:
 
        check_implicit_admin: true
 
        name: root
 
        host: "{{ item }}"
 
        password: "root_password"
 
      with_items:
 
        - "localhost"
 
        - "127.0.0.1"
 
        - "::1"
 
        - "{{ ansible_hostname }}"
 

	
 
    - name: Deploy username and password for the root database user
 
      copy:
 
        src: "deprecated-root-my.cnf"
 
        dest: "/root/.my.cnf"
 
        owner: root
 
        group: root
 
        mode: 0400
 

	
 
    - name: Disable use of unix socket login
 
      command: "mysql -B -e \"update mysql.user set plugin='' where user='root' and plugin='unix_socket'; flush privileges;\""
 

	
 
    - name: Create Debian system maintenance user
 
      mysql_user:
 
        name: debian-sys-maint
 
        password: debian-sys-maint-password
 

	
 
    - name: Deploy Debian system maintenance user login configuration
 
      copy:
 
        src: "deprecated-debian.cnf"
 
        dest: "/etc/mysql/debian.cnf"
0 comments (0 inline, 0 general)