Clean keystone resources

This commit is contained in:
Łukasz Oleś 2015-07-22 23:27:04 +00:00
parent 4957dd9d30
commit ecfd4d103c
16 changed files with 28 additions and 132 deletions

View File

@ -69,13 +69,13 @@ def deploy():
# KEYSTONE # KEYSTONE
keystone_puppet = vr.create('keystone_puppet', 'resources/keystone_puppet', {})[0] keystone_puppet = vr.create('keystone_puppet', 'resources/keystone_puppet', {})[0]
keystone_db = vr.create('keystone_db', 'resources/mariadb_keystone_db/', { keystone_db = vr.create('keystone_db', 'resources/mariadb_db/', {
'db_name': 'keystone_db', 'db_name': 'keystone_db',
'login_user': 'root' 'login_user': 'root'
})[0] })[0]
keystone_db_user = vr.create('keystone_db_user', 'resources/mariadb_keystone_user/', { keystone_db_user = vr.create('keystone_db_user', 'resources/mariadb_user/', {
'new_user_name': 'keystone', 'user_name': 'keystone',
'new_user_password': 'keystone', 'user_password': 'keystone',
})[0] })[0]
keystone_service_endpoint = vr.create('keystone_service_endpoint', 'resources/keystone_service_endpoint', { keystone_service_endpoint = vr.create('keystone_service_endpoint', 'resources/keystone_service_endpoint', {
'endpoint_name': 'keystone', 'endpoint_name': 'keystone',
@ -107,12 +107,14 @@ def deploy():
'port': 'login_port', 'port': 'login_port',
'root_user': 'login_user', 'root_user': 'login_user',
'root_password': 'login_password', 'root_password': 'login_password',
'ip' : 'db_host',
}) })
signals.connect(keystone_db, keystone_db_user, { signals.connect(keystone_db, keystone_db_user, {
'db_name', 'db_name',
'login_port', 'login_port',
'login_user', 'login_user',
'login_password' 'login_password',
'db_host'
}) })
signals.connect(node1, keystone_service_endpoint) signals.connect(node1, keystone_service_endpoint)
@ -141,8 +143,9 @@ def deploy():
'db_name', 'db_name',
}) })
signals.connect(keystone_db_user, keystone_puppet, { signals.connect(keystone_db_user, keystone_puppet, {
'new_user_name': 'db_user', 'user_name': 'db_user',
'new_user_password': 'db_password' 'user_password': 'db_password',
'db_host' : 'db_host'
}) })
# OPENRC # OPENRC

View File

@ -8,16 +8,16 @@ input:
value: admin_token value: admin_token
db_user: db_user:
schema: str! schema: str!
value: keystone value:
db_password: db_password:
schema: str! schema: str!
value: keystone value:
db_name: db_name:
schema: str! schema: str!
value: keystone value:
db_host: db_host:
schema: str! schema: str!
value: keystone value:
admin_port: admin_port:
schema: int! schema: int!

View File

@ -8,4 +8,4 @@
login_user: root login_user: root
login_password: {{login_password}} login_password: {{login_password}}
login_port: {{login_port}} login_port: {{login_port}}
login_host: 127.0.0.1 login_host: {{db_host}}

View File

@ -8,4 +8,4 @@
login_user: root login_user: root
login_password: {{ login_password }} login_password: {{ login_password }}
login_port: {{ login_port }} login_port: {{ login_port }}
login_host: 127.0.0.1 login_host: {{db_host}}

View File

@ -8,6 +8,9 @@ input:
db_name: db_name:
schema: str! schema: str!
value: value:
db_host:
schema: str!
value:
login_user: login_user:
schema: str! schema: str!

View File

@ -1,11 +0,0 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- name: mariadb db
mysql_db:
name: {{db_name}}
state: absent
login_user: root
login_password: {{login_password}}
login_port: {{login_port}}
login_host: 127.0.0.1

View File

@ -1,13 +0,0 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- name: mariadb db
mysql_db:
name: {{ db_name }}
#collation: utf8_encode_ci
encoding: utf8
state: present
login_user: root
login_password: {{ login_password }}
login_port: {{ login_port }}
login_host: 127.0.0.1

View File

@ -1,30 +0,0 @@
id: mariadb_keystone_db
handler: ansible
version: 1.0.0
actions:
run: run.yml
remove: remove.yml
input:
db_name:
schema: str!
value: keystone_db
login_user:
schema: str!
value: root
login_password:
schema: str!
value:
login_port:
schema: int!
value:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
tags: [resource/mariadb_keystone_db, resources/mariadb]

View File

@ -1,11 +0,0 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- name: mariadb user
mysql_user:
name: {{new_user_name}}
state: absent
login_user: root
login_password: {{login_password}}
login_port: {{login_port}}
login_host: 127.0.0.1

View File

@ -1,14 +0,0 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- name: mariadb user
mysql_user:
name: {{ new_user_name }}
password: {{ new_user_password }}
priv: {{ db_name }}.*:ALL
host: '%'
state: present
login_user: root
login_password: {{ login_password }}
login_port: {{ login_port }}
login_host: 127.0.0.1

View File

@ -1,37 +0,0 @@
id: mariadb_keystone_user
handler: ansible
version: 1.0.0
actions:
run: run.yml
remove: remove.yml
input:
new_user_password:
schema: str!
value: keystone
new_user_name:
schema: str!
value: keystone
db_name:
schema: str!
value:
login_password:
schema: str!
value:
login_port:
schema: int!
value:
login_user:
schema: str!
value:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
tags: [resource/mariadb_keystone_user, resources/mariadb]

View File

@ -8,4 +8,4 @@
login_user: root login_user: root
login_password: {{login_password}} login_password: {{login_password}}
login_port: {{login_port}} login_port: {{login_port}}
login_host: 127.0.0.1 login_host: {{db_host}}

View File

@ -11,4 +11,4 @@
login_user: root login_user: root
login_password: {{ login_password }} login_password: {{ login_password }}
login_port: {{ login_port }} login_port: {{ login_port }}
login_host: 127.0.0.1 login_host: {{db_host}}

View File

@ -15,6 +15,9 @@ input:
db_name: db_name:
schema: str! schema: str!
value: value:
db_host:
schema: str!
value:
login_password: login_password:
schema: str! schema: str!

View File

@ -25,6 +25,7 @@ resources:
login_password: 'mariadb_service::root_password' login_password: 'mariadb_service::root_password'
login_port: 'mariadb_service::port' login_port: 'mariadb_service::port'
db_name: 'keystone' db_name: 'keystone'
db_host: 'mariadb_service::ip'
user_password: 'keystone' user_password: 'keystone'
user_name: 'keystone' user_name: 'keystone'
ip: '{{ip}}' ip: '{{ip}}'

View File

@ -4,7 +4,8 @@ resources:
- id: keystone_db - id: keystone_db
from: resources/mariadb_db from: resources/mariadb_db
values: values:
db_name: {{db_name}} db_name: '{{db_name}}'
db_host: '{{db_host}}'
login_user: '{{login_user}}' login_user: '{{login_user}}'
login_password: '{{login_password}}' login_password: '{{login_password}}'
login_port: '{{login_port}}' login_port: '{{login_port}}'
@ -18,6 +19,7 @@ resources:
user_password: '{{user_password}}' user_password: '{{user_password}}'
user_name: '{{user_name}}' user_name: '{{user_name}}'
db_name: 'keystone_db::db_name' db_name: 'keystone_db::db_name'
db_host: '{{db_host}}'
login_user: 'keystone_db::login_user' login_user: 'keystone_db::login_user'
login_password: 'keystone_db::login_password' login_password: 'keystone_db::login_password'
login_port: 'keystone_db::login_port' login_port: 'keystone_db::login_port'