From 85a92024beaab52cba3169aa5c68a441352f36d5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 7 Jun 2016 12:42:42 +0100 Subject: [PATCH] Minimum example playbook could let suppose db creation With the adapted example, ppl realise they should create the DB for keystone before running the role. Change-Id: I3d0d5e9fbc9688805253cbdb5cf177e44281fd02 Signed-off-by: Jean-Philippe Evrard --- README.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.rst b/README.rst index 35242b20..b72dbceb 100644 --- a/README.rst +++ b/README.rst @@ -45,6 +45,31 @@ Example Playbook - name: Installation and setup of Keystone hosts: keystone_all user: root + pre_tasks: + - name: Create DB for service + mysql_db: + login_user: "root" + login_password: "secrete" + login_host: "localhost" + name: "{{ keystone_galera_database }}" + state: "present" + delegate_to: "{{ keystone_galera_address }}" + when: inventory_hostname == groups['keystone_all'][0] + - name: Grant access to the DB for the service + mysql_user: + login_user: "root" + login_password: "secrete" + login_host: "localhost" + name: "{{ keystone_galera_database }}" + password: "{{ keystone_container_mysql_password }}" + host: "{{ item }}" + state: "present" + priv: "{{ keystone_galera_database }}.*:ALL" + with_items: + - "localhost" + - "%" + delegate_to: "{{ keystone_galera_address }}" + when: inventory_hostname == groups['keystone_all'][0] roles: - { role: "os_keystone", tags: [ "os-keystone" ] } vars: