Relocating DB and DB user creation tasks
Revoving the database and database user creation tasks from the Magnum role and placing them in the extras/os-magnum-install.yml file. Change-Id: I73d4906d2559540dd728f9f002512b13e1d1cea3
This commit is contained in:

committed by
Jesse Pretorius

parent
8b282810b6
commit
03ff822c9f
@@ -44,6 +44,34 @@
|
|||||||
retries: 3
|
retries: 3
|
||||||
tags:
|
tags:
|
||||||
- ssh-wait
|
- ssh-wait
|
||||||
|
- name: Create Magnum's database tables
|
||||||
|
mysql_db:
|
||||||
|
login_user: "{{ galera_root_user }}"
|
||||||
|
login_password: "{{ galera_root_password }}"
|
||||||
|
login_host: "{{ magnum_galera_address }}"
|
||||||
|
name: "{{ magnum_galera_database_name }}"
|
||||||
|
state: "present"
|
||||||
|
tags:
|
||||||
|
- magnum-database-setup
|
||||||
|
- magnum-db-setup
|
||||||
|
- magnum-setup
|
||||||
|
- name: Give Magnum database access
|
||||||
|
mysql_user:
|
||||||
|
login_user: "{{ galera_root_user }}"
|
||||||
|
login_password: "{{ galera_root_password }}"
|
||||||
|
login_host: "{{ magnum_galera_address }}"
|
||||||
|
name: "{{ magnum_galera_user }}"
|
||||||
|
password: "{{ magnum_galera_password }}"
|
||||||
|
priv: "{{ magnum_galera_database_name }}.*:ALL"
|
||||||
|
host: "{{ item }}"
|
||||||
|
state: "present"
|
||||||
|
with_items:
|
||||||
|
- "localhost"
|
||||||
|
- "%"
|
||||||
|
tags:
|
||||||
|
- magnum-database-setup
|
||||||
|
- magnum-db-setup
|
||||||
|
- magnum-setup
|
||||||
- name: Sort the rabbitmq servers
|
- name: Sort the rabbitmq servers
|
||||||
dist_sort:
|
dist_sort:
|
||||||
value_to_lookup: "{{ container_name }}"
|
value_to_lookup: "{{ container_name }}"
|
||||||
@@ -72,7 +100,6 @@
|
|||||||
- magnum-logs
|
- magnum-logs
|
||||||
roles:
|
roles:
|
||||||
- role: "openstack-ansible-magnum"
|
- role: "openstack-ansible-magnum"
|
||||||
magnum_galera_address: "{{ galera_address }}"
|
|
||||||
magnum_venv_tag: "{{ openstack_release }}"
|
magnum_venv_tag: "{{ openstack_release }}"
|
||||||
magnum_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/magnum-{{ openstack_release }}.tgz"
|
magnum_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/magnum-{{ openstack_release }}.tgz"
|
||||||
tags:
|
tags:
|
||||||
@@ -83,5 +110,9 @@
|
|||||||
- "system-crontab-coordination"
|
- "system-crontab-coordination"
|
||||||
vars:
|
vars:
|
||||||
galera_address: "{{ internal_lb_vip_address }}"
|
galera_address: "{{ internal_lb_vip_address }}"
|
||||||
|
|
||||||
|
magnum_galera_address: "{{ internal_lb_vip_address }}"
|
||||||
|
magnum_galera_database_name: magnum_service
|
||||||
|
magnum_galera_user: magnum
|
||||||
ansible_hostname: "{{ container_name }}"
|
ansible_hostname: "{{ container_name }}"
|
||||||
is_metal: "{{ properties.is_metal|default(false) }}"
|
is_metal: "{{ properties.is_metal|default(false) }}"
|
||||||
|
@@ -13,36 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Create Magnum's database tables
|
|
||||||
mysql_db:
|
|
||||||
login_user: "{{ galera_root_user }}"
|
|
||||||
login_password: "{{ galera_root_password }}"
|
|
||||||
login_host: "{{ magnum_galera_address }}"
|
|
||||||
name: "{{ magnum_galera_database_name }}"
|
|
||||||
state: "present"
|
|
||||||
tags:
|
|
||||||
- magnum-database-setup
|
|
||||||
- magnum-db-setup
|
|
||||||
- magnum-setup
|
|
||||||
|
|
||||||
- name: Give Magnum database access
|
|
||||||
mysql_user:
|
|
||||||
login_user: "{{ galera_root_user }}"
|
|
||||||
login_password: "{{ galera_root_password }}"
|
|
||||||
login_host: "{{ magnum_galera_address }}"
|
|
||||||
name: "{{ magnum_galera_user }}"
|
|
||||||
password: "{{ magnum_galera_password }}"
|
|
||||||
priv: "{{ magnum_galera_database_name }}.*:ALL"
|
|
||||||
host: "{{ item }}"
|
|
||||||
state: "present"
|
|
||||||
with_items:
|
|
||||||
- "localhost"
|
|
||||||
- "%"
|
|
||||||
tags:
|
|
||||||
- magnum-database-setup
|
|
||||||
- magnum-db-setup
|
|
||||||
- magnum-setup
|
|
||||||
|
|
||||||
- name: Perform a synchronization of the Magnum database
|
- name: Perform a synchronization of the Magnum database
|
||||||
command: "{{ magnum_venv_bin}}/magnum-db-manage upgrade"
|
command: "{{ magnum_venv_bin}}/magnum-db-manage upgrade"
|
||||||
sudo: yes
|
sudo: yes
|
||||||
|
Reference in New Issue
Block a user