You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
3.0 KiB
YAML
84 lines
3.0 KiB
YAML
---
|
|
# Parameters:
|
|
# playbook inventory
|
|
# stage := the name of the stage (e.g. devnso, qanso, prodnso)
|
|
# tenant := object with tenant related data
|
|
# key :=
|
|
# name :=
|
|
# cluster := object with cluster specific data (optional)
|
|
# ...
|
|
# data := object with action specific data (optional)
|
|
# ...
|
|
# smardigo message callback
|
|
# scope_id := (scope id of the management process)
|
|
# process_instance_id := (process instance id of the management process)
|
|
# smardigo_management_action := (smardigo management action anme of the management process)
|
|
|
|
#############################################################
|
|
# Creating inventory dynamically for given parameters
|
|
#############################################################
|
|
|
|
- import_playbook: pmci-inventory-cluster.yml
|
|
- import_playbook: pmci-inventory-database.yml
|
|
|
|
#############################################################
|
|
# Creating services for created inventory
|
|
#############################################################
|
|
|
|
- hosts: "pmci_server_selector"
|
|
serial: "{{ serial_number | default(1) }}"
|
|
remote_user: root
|
|
|
|
pre_tasks:
|
|
- name: "Import autodiscover pre-tasks"
|
|
import_tasks: tasks/autodiscover_pre_tasks.yml
|
|
become: false
|
|
tags:
|
|
- always
|
|
|
|
- name: "Setting default variables pre-tasks"
|
|
import_tasks: tasks/pmci_set_default_variables.yml
|
|
become: false
|
|
tags:
|
|
- always
|
|
|
|
roles:
|
|
- role: connect
|
|
when: "'connect' in group_names"
|
|
|
|
- role: connect_wordpress
|
|
when: "'connect_wordpress' in group_names"
|
|
|
|
#############################################################
|
|
# Updating databases for created inventory
|
|
#############################################################
|
|
|
|
- hosts: "pmci_database_selector_maria"
|
|
serial: "{{ serial_number | default(1) }}"
|
|
|
|
pre_tasks:
|
|
- name: "Import autodiscover pre-tasks"
|
|
import_tasks: tasks/pmci_set_default_variables.yml
|
|
become: false
|
|
tags:
|
|
- always
|
|
|
|
tasks:
|
|
- name: "Initialize wordpress admin user if necessary"
|
|
community.mysql.mysql_query:
|
|
login_db: "{{ connect_wordpress_maria_database }}"
|
|
login_user: "{{ connect_wordpress_maria_username }}"
|
|
login_password: "{{ connect_wordpress_maria_password }}"
|
|
login_unix_socket: /run/mysqld/mysqld.sock
|
|
query:
|
|
- UPDATE wp_options SET option_value = '{{ wordpress_admin_email }}' where option_name='admin_email' AND option_value='mAgmVXveeeMRgKP@netgo.de'
|
|
- UPDATE wp_users SET user_email = '{{ wordpress_admin_email }}' where user_login='wordpress-admin' AND user_email='mAgmVXveeeMRgKP@netgo.de'
|
|
- UPDATE wp_users SET user_pass = '{{ connect_wordpress_admin_password | md5 }}' where user_login='wordpress-admin' AND user_pass='$P$B1.mAgmVXveeeMRgKP.OYl5k/jJOjY.'
|
|
single_transaction: true
|
|
|
|
#############################################################
|
|
# Sending smardigo management message to process
|
|
#############################################################
|
|
|
|
- import_playbook: pmci-callback.yml
|