From 40e36d2bc4cbc6e562c355da06245e627db18086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ole=C5=9B?= Date: Wed, 22 Apr 2015 09:42:34 +0000 Subject: [PATCH 1/3] Add mariadb db and user resources --- x/resources/mariadb_table/meta.yaml | 10 ---------- x/resources/mariadb_user/actions/remove.yml | 11 +++++++++++ x/resources/mariadb_user/actions/run.yml | 13 +++++++++++++ x/resources/mariadb_user/meta.yaml | 10 ++++++++-- 4 files changed, 32 insertions(+), 12 deletions(-) delete mode 100644 x/resources/mariadb_table/meta.yaml create mode 100644 x/resources/mariadb_user/actions/remove.yml create mode 100644 x/resources/mariadb_user/actions/run.yml diff --git a/x/resources/mariadb_table/meta.yaml b/x/resources/mariadb_table/meta.yaml deleted file mode 100644 index 40b92c47..00000000 --- a/x/resources/mariadb_table/meta.yaml +++ /dev/null @@ -1,10 +0,0 @@ -id: mariadb_user -handler: ansible -version: 1.0.0 -actions: - run: run.yml - remove: remove.yml -input: - name: name - password: password - users: [] diff --git a/x/resources/mariadb_user/actions/remove.yml b/x/resources/mariadb_user/actions/remove.yml new file mode 100644 index 00000000..9df0be6c --- /dev/null +++ b/x/resources/mariadb_user/actions/remove.yml @@ -0,0 +1,11 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: mariadb user + mysql_user: + name: {{name}} + state: absent + login_user: root + login_password: {{login_password}} + login_port: {{login_port}} + login_host: 127.0.0.1 diff --git a/x/resources/mariadb_user/actions/run.yml b/x/resources/mariadb_user/actions/run.yml new file mode 100644 index 00000000..7f50378a --- /dev/null +++ b/x/resources/mariadb_user/actions/run.yml @@ -0,0 +1,13 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: mariadb user + mysql_user: + name: {{name}} + password: {{password}} + priv: {{db}}.*:ALL + state: present + login_user: root + login_password: {{login_password}} + login_port: {{login_port}} + login_host: 127.0.0.1 diff --git a/x/resources/mariadb_user/meta.yaml b/x/resources/mariadb_user/meta.yaml index db859484..2d5a34aa 100644 --- a/x/resources/mariadb_user/meta.yaml +++ b/x/resources/mariadb_user/meta.yaml @@ -5,5 +5,11 @@ actions: run: run.yml remove: remove.yml input: - name: name - password: password + password: + db: + login_password: + login_port: + login_user: + ip: + ssh_key: + ssh_user: From ecd9e3bda23843e66cc356891ce0582bbb40c6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ole=C5=9B?= Date: Wed, 22 Apr 2015 09:50:20 +0000 Subject: [PATCH 2/3] Mariadb resource --- x/resources/mariadb_db/actions/remove.yml | 11 +++++++++++ x/resources/mariadb_db/actions/run.yml | 11 +++++++++++ x/resources/mariadb_db/meta.yaml | 13 +++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 x/resources/mariadb_db/actions/remove.yml create mode 100644 x/resources/mariadb_db/actions/run.yml create mode 100644 x/resources/mariadb_db/meta.yaml diff --git a/x/resources/mariadb_db/actions/remove.yml b/x/resources/mariadb_db/actions/remove.yml new file mode 100644 index 00000000..fe6d6488 --- /dev/null +++ b/x/resources/mariadb_db/actions/remove.yml @@ -0,0 +1,11 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: mariadb db + mysql_db: + name: {{name}} + state: absent + login_user: root + login_password: {{login_password}} + login_port: {{login_port}} + login_host: 127.0.0.1 diff --git a/x/resources/mariadb_db/actions/run.yml b/x/resources/mariadb_db/actions/run.yml new file mode 100644 index 00000000..fda96b5b --- /dev/null +++ b/x/resources/mariadb_db/actions/run.yml @@ -0,0 +1,11 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: mariadb db + mysql_db: + name: {{name}} + state: present + login_user: root + login_password: {{login_password}} + login_port: {{login_port}} + login_host: 127.0.0.1 diff --git a/x/resources/mariadb_db/meta.yaml b/x/resources/mariadb_db/meta.yaml new file mode 100644 index 00000000..6bd49b7d --- /dev/null +++ b/x/resources/mariadb_db/meta.yaml @@ -0,0 +1,13 @@ +id: mariadb_table +handler: ansible +version: 1.0.0 +actions: + run: run.yml + remove: remove.yml +input: + login_password: + login_port: + login_user: + ip: + ssh_key: + ssh_user: From 2f960229ab7c426f6dfa6ddcc21e6a0cc2f4121d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ole=C5=9B?= Date: Wed, 22 Apr 2015 16:21:46 +0000 Subject: [PATCH 3/3] Keystone resource and action run --- x/resources/keystone/actions/run.yml | 13 ++++++++++--- x/resources/keystone/meta.yaml | 8 ++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/x/resources/keystone/actions/run.yml b/x/resources/keystone/actions/run.yml index e223fe8f..7146e52d 100644 --- a/x/resources/keystone/actions/run.yml +++ b/x/resources/keystone/actions/run.yml @@ -1,6 +1,13 @@ -# TODO - hosts: [{{ ip }}] sudo: yes tasks: - - shell: docker run -d --net="host" --privileged \ - --name {{ name }} {{ image }} + - name: keystone container + docker: + name: {{ name }} + image: {{ image }} + state: running + ports: + - {{ port }}:5000 + - {{ admin_port }}:35357 + volumnes: + - {{ config_dir }}:/etc/keystone diff --git a/x/resources/keystone/meta.yaml b/x/resources/keystone/meta.yaml index 404e2c7e..fbc98de0 100644 --- a/x/resources/keystone/meta.yaml +++ b/x/resources/keystone/meta.yaml @@ -2,6 +2,10 @@ id: keystone handler: ansible version: 1.0.0 input: + image: kollaglue/centos-rdo-keystone + config_dir: + admin_port: + port: ip: - port: 5000 - image: garland/docker-openstack-keystone + ssh_key: + ssh_user: