diff --git a/resources/keystone_config/meta.yaml b/resources/keystone_config/meta.yaml index 9b0bb4b..b9b177f 100644 --- a/resources/keystone_config/meta.yaml +++ b/resources/keystone_config/meta.yaml @@ -5,10 +5,10 @@ version: 1.0.0 input: config_dir: schema: str! - value: + value: /etc/solar/keystone admin_token: schema: str! - value: /etc/solar/keystone + value: db_password: schema: str! value: password diff --git a/resources/keystone_role/actions/remove.yml b/resources/keystone_role/actions/remove.yml new file mode 100644 index 0000000..386d38e --- /dev/null +++ b/resources/keystone_role/actions/remove.yml @@ -0,0 +1,5 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: keystone role + keystone_user: endpoint=http://{{keystone_host}}:{{keystone_port}}/v2.0/ token={{admin_token}} user={{user_name}} tenant={{tenant_name}} role={{role_name}} state=absent diff --git a/resources/keystone_role/actions/run.yml b/resources/keystone_role/actions/run.yml new file mode 100644 index 0000000..8896008 --- /dev/null +++ b/resources/keystone_role/actions/run.yml @@ -0,0 +1,5 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: keystone role + keystone_user: endpoint=http://{{keystone_host}}:{{keystone_port}}/v2.0/ token={{admin_token}} user={{user_name}} tenant={{tenant_name}} role={{role_name}} state=present diff --git a/resources/keystone_role/meta.yaml b/resources/keystone_role/meta.yaml new file mode 100644 index 0000000..1d8fe6c --- /dev/null +++ b/resources/keystone_role/meta.yaml @@ -0,0 +1,33 @@ +id: keystone_user +handler: ansible +version: 1.0.0 +input: + keystone_host: + schema: str! + value: + keystone_port: + schema: int! + value: + admin_token: + schema: str! + value: + user_name: + schema: str! + value: + tenant_name: + schema: str! + value: + role_name: + schema: str! + value: + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: + +tags: [resource/keystone_user, resources/keystone] diff --git a/resources/keystone_service/meta.yaml b/resources/keystone_service/meta.yaml index be5b389..746c2d6 100644 --- a/resources/keystone_service/meta.yaml +++ b/resources/keystone_service/meta.yaml @@ -4,7 +4,7 @@ version: 1.0.0 input: image: schema: str! - value: kollaglue/centos-rdo-keystone + value: kollaglue/centos-rdo-j-keystone config_dir: schema: str! value: /etc/solar/keystone diff --git a/resources/keystone_service_endpoint/actions/remove.yaml b/resources/keystone_service_endpoint/actions/remove.yaml new file mode 100644 index 0000000..b15fe77 --- /dev/null +++ b/resources/keystone_service_endpoint/actions/remove.yaml @@ -0,0 +1 @@ +#todo diff --git a/resources/keystone_service_endpoint/actions/run.yaml b/resources/keystone_service_endpoint/actions/run.yaml new file mode 100644 index 0000000..6fe788a --- /dev/null +++ b/resources/keystone_service_endpoint/actions/run.yaml @@ -0,0 +1,19 @@ +- hosts: [{{ ip }}] + sudo: yes + vars: + ip: {{ip}} + port: {{port}} + admin_port: {{admin_port}} + tasks: + - name: keystone service and endpoint + keystone_service: + token: {{admin_token}} + name: {{name}} + type: {{type}} + description: {{description}} + publicurl: {{publicurl}} + internalurl: {{internalurl}} + adminurl: {{adminurl}} + region: "RegionOne" + state: present + endpoint: http://{{keystone_host}}:{{keystone_port}}/v2.0/ diff --git a/resources/keystone_service_endpoint/meta.yaml b/resources/keystone_service_endpoint/meta.yaml new file mode 100644 index 0000000..ce0b740 --- /dev/null +++ b/resources/keystone_service_endpoint/meta.yaml @@ -0,0 +1,49 @@ +id: keystone_user +handler: ansible +version: 1.0.0 +input: + keystone_host: + schema: str! + value: + keystone_port: + schema: int! + value: + admin_token: + schema: str! + value: + port: + schema: int! + value: + admin_port: + schema: int! + value: + name: + schema: str! + value: + type: + schema: str! + value: + description: + schema: str! + value: + publicurl: + schema: str! + value: + internalurl: + schema: str! + value: + adminurl: + schema: str! + value: + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: + +tags: [resource/keystone_tenant, resources/keystone] + diff --git a/resources/keystone_tenant/actions/remove.yml b/resources/keystone_tenant/actions/remove.yml new file mode 100644 index 0000000..b19a2fc --- /dev/null +++ b/resources/keystone_tenant/actions/remove.yml @@ -0,0 +1,5 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: keystone tenant + keystone_user: endpoint=http://{{keystone_host}}:{{keystone_port}}/v2.0/ token={{admin_token}} tenant={{tenant_name}} state=absent diff --git a/resources/keystone_tenant/actions/run.yml b/resources/keystone_tenant/actions/run.yml new file mode 100644 index 0000000..5122a7d --- /dev/null +++ b/resources/keystone_tenant/actions/run.yml @@ -0,0 +1,5 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: keystone tenant + keystone_user: endpoint=http://{{keystone_host}}:{{keystone_port}}/v2.0/ token={{admin_token}} tenant={{tenant_name}} state=present diff --git a/resources/keystone_tenant/meta.yaml b/resources/keystone_tenant/meta.yaml new file mode 100644 index 0000000..ac7e6d6 --- /dev/null +++ b/resources/keystone_tenant/meta.yaml @@ -0,0 +1,27 @@ +id: keystone_user +handler: ansible +version: 1.0.0 +input: + keystone_host: + schema: str! + value: + keystone_port: + schema: int! + value: + admin_token: + schema: str! + value: + tenant_name: + schema: str! + value: + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: + +tags: [resource/keystone_tenant, resources/keystone] diff --git a/resources/keystone_user/actions/remove.yml b/resources/keystone_user/actions/remove.yml index 492749e..a56289d 100644 --- a/resources/keystone_user/actions/remove.yml +++ b/resources/keystone_user/actions/remove.yml @@ -2,5 +2,4 @@ sudo: yes tasks: - name: keystone user - - keystone_user: endpoint=http://{keystone_host}}:{{keystone_port}}/v2.0/ user={{user_name}} tenant={{tenant_name}} state=absent - - keystone_user: endpoint=http://{keystone_host}}:{{keystone_port}}/v2.0/ tenant={{tenant_name}} state=absent + keystone_user: endpoint=http://{{keystone_host}}:{{keystone_port}}/v2.0/ token={{admin_token}} user={{user_name}} password={{user_password}} tenant={{tenant_name}} state=absent diff --git a/resources/keystone_user/actions/run.yml b/resources/keystone_user/actions/run.yml index 7a861d7..2deae25 100644 --- a/resources/keystone_user/actions/run.yml +++ b/resources/keystone_user/actions/run.yml @@ -3,9 +3,4 @@ tasks: - name: install python-keystoneclient shell: pip install python-keystoneclient - - name: keystone tenant - keystone_user: endpoint=http://localhost:35357/v2.0/ tenant={{ tenant_name }} token={{ login_token }} state=present - - name: keystone user - keystone_user: endpoint=http://localhost:35357/v2.0/ user={{ user_name }} password={{ user_password }} tenant={{ tenant_name }} token={{ login_token }} state=present - - name: keystone role - keystone_user: endpoint=http://localhost:35357/v2.0/ role={{ role_name }} user={{ user_name }} tenant={{ tenant_name }} token={{ login_token }} state=present + keystone_user: endpoint=http://{{ keystone_host }}:{{ keystone_port }}/v2.0/ token={{ admin_token }} user={{ user_name }} password={{ user_password }} tenant={{ tenant_name }} state=present diff --git a/resources/keystone_user/meta.yaml b/resources/keystone_user/meta.yaml index 07d445a..32b4ce2 100644 --- a/resources/keystone_user/meta.yaml +++ b/resources/keystone_user/meta.yaml @@ -8,10 +8,7 @@ input: keystone_admin_port: schema: int! value: - login_user: - schema: str - value: - login_token: + admin_token: schema: str! value: role_name: diff --git a/resources/mariadb_service/meta.yaml b/resources/mariadb_service/meta.yaml index 826a062..1691da8 100644 --- a/resources/mariadb_service/meta.yaml +++ b/resources/mariadb_service/meta.yaml @@ -4,7 +4,7 @@ version: 1.0.0 input: image: schema: str! - value: kollaglue/fedora-rdo-mariadb-app + value: mariadb root_password: schema: str! value: password diff --git a/resources/rabbitmq_config/actions/remove.yml b/resources/rabbitmq_config/actions/remove.yml new file mode 100644 index 0000000..7e452a4 --- /dev/null +++ b/resources/rabbitmq_config/actions/remove.yml @@ -0,0 +1,4 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - file: path={{config_dir}} state=absent diff --git a/resources/rabbitmq_config/actions/run.yml b/resources/rabbitmq_config/actions/run.yml new file mode 100644 index 0000000..9cd1523 --- /dev/null +++ b/resources/rabbitmq_config/actions/run.yml @@ -0,0 +1,8 @@ +- hosts: [{{ ip }}] + sudo: yes + vars: + admin_user: {{admin_user}} + admin_password: {{admin_password}} + tasks: + - file: path={{config_dir}} state=directory + - template: src={{resource_dir}}/templates/rabbitmq.conf dest={{config_dir}}/rabbitmq.conf diff --git a/resources/rabbitmq_config/meta.yaml b/resources/rabbitmq_config/meta.yaml new file mode 100644 index 0000000..f6f8c8d --- /dev/null +++ b/resources/rabbitmq_config/meta.yaml @@ -0,0 +1,22 @@ +id: rabbitmq_config +handler: ansible +version: 1.0.0 +input: + config_dir: + schema: str! + value: + admin_name: + schema: str! + value: + admin_password: + schema: str! + value: + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: diff --git a/resources/rabbitmq_config/templates/rabbitmq.conf b/resources/rabbitmq_config/templates/rabbitmq.conf new file mode 100644 index 0000000..85db812 --- /dev/null +++ b/resources/rabbitmq_config/templates/rabbitmq.conf @@ -0,0 +1,30 @@ +[ + {rabbit, [ + {cluster_partition_handling, autoheal}, + {default_permissions, [<<".*">>, <<".*">>, <<".*">>]}, + {default_vhost, <<"/">>}, + {log_levels, [connection,info,error]}, + {tcp_listen_options, [ + binary, + {packet, raw}, + {reuseaddr, true}, + {backlog, 128}, + {nodelay, true}, + {exit_on_close, false}, + {keepalive, true} + ]}, + {default_user, <<"{{default_user}}">>}, + {default_pass, <<"{{default_password}}">>} + ]}, + {kernel, [ + {inet_default_connect_options, [{nodelay,true}]}, + {inet_dist_listen_max, 41055}, + {inet_dist_listen_min, 41055} + ]} +, + {rabbitmq_management, [ + {listener, [ + {port, 15672} + ]} + ]} +]. diff --git a/resources/rabbitmq_service/actions/remove.yml b/resources/rabbitmq_service/actions/remove.yml new file mode 100644 index 0000000..3230633 --- /dev/null +++ b/resources/rabbitmq_service/actions/remove.yml @@ -0,0 +1,9 @@ +# TODO +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: rabbitmq container + docker: + name: {{ container_name }} + image: {{ image }} + state: absent diff --git a/resources/rabbitmq_service/actions/run.yml b/resources/rabbitmq_service/actions/run.yml new file mode 100644 index 0000000..f928c29 --- /dev/null +++ b/resources/rabbitmq_service/actions/run.yml @@ -0,0 +1,17 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - name: rabbitmq container + docker: + command: /bin/bash -c rabbitmq-server + name: {{ container_name }} + image: {{ image }} + state: running + expose: + - 5672 + - 15672 + ports: + - {{ port }}:5672 + - {{ management_port }}:15672 + env: + RABBITMQ_NODENAME: {{container_name}} diff --git a/resources/rabbitmq_service/meta.yaml b/resources/rabbitmq_service/meta.yaml new file mode 100644 index 0000000..50dc234 --- /dev/null +++ b/resources/rabbitmq_service/meta.yaml @@ -0,0 +1,25 @@ +id: rabbitmq_service +handler: ansible +version: 1.0.0 +input: + image: + schema: str! + value: rabbitmq:3-management + container_name: + schema: str! + value: + management_port: + schema: str! + value: + port: + schema: str! + value: + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: diff --git a/resources/rabbitmq_service/templates/erlang.cookie b/resources/rabbitmq_service/templates/erlang.cookie new file mode 100644 index 0000000..cfbe5c1 --- /dev/null +++ b/resources/rabbitmq_service/templates/erlang.cookie @@ -0,0 +1 @@ +{{erlang_cookie}} diff --git a/resources/rabbitmq_user/actions/remove.yml b/resources/rabbitmq_user/actions/remove.yml new file mode 100644 index 0000000..2d700a8 --- /dev/null +++ b/resources/rabbitmq_user/actions/remove.yml @@ -0,0 +1,8 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - new_rabbitmq_user: user={{user_name}} + vhost={{vhost_name}} + state=absent + node={{container_name}} + rabbitmqctl="docker exec -it {{container_name}} rabbitmqctl" diff --git a/resources/rabbitmq_user/actions/run.yml b/resources/rabbitmq_user/actions/run.yml new file mode 100644 index 0000000..85743a1 --- /dev/null +++ b/resources/rabbitmq_user/actions/run.yml @@ -0,0 +1,12 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - new_rabbitmq_user: user={{user_name}} + password={{password}} + vhost={{vhost_name}} + configure_priv=.* + read_priv=.* + write_priv=.* + state=present + node={{container_name}} + rabbitmqctl="docker exec -it {{container_name}} rabbitmqctl" diff --git a/resources/rabbitmq_user/meta.yaml b/resources/rabbitmq_user/meta.yaml new file mode 100644 index 0000000..7a6b659 --- /dev/null +++ b/resources/rabbitmq_user/meta.yaml @@ -0,0 +1,25 @@ +id: keystone_user +handler: ansible +version: 1.0.0 +input: + container_name: + schema: str! + value: + user_name: + schema: str! + value: + password: + schema: str! + value: + vhost_name: + schema: str! + value: + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: diff --git a/resources/rabbitmq_vhost/actions/remove.yml b/resources/rabbitmq_vhost/actions/remove.yml new file mode 100644 index 0000000..8846786 --- /dev/null +++ b/resources/rabbitmq_vhost/actions/remove.yml @@ -0,0 +1,7 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - new_rabbitmq_vhost: name={{vhost_name}} + state=absent + rabbitmqctl="docker exec -it {{container_name}} rabbitmqctl" + node={{container_name}} diff --git a/resources/rabbitmq_vhost/actions/run.yml b/resources/rabbitmq_vhost/actions/run.yml new file mode 100644 index 0000000..50a51e8 --- /dev/null +++ b/resources/rabbitmq_vhost/actions/run.yml @@ -0,0 +1,7 @@ +- hosts: [{{ ip }}] + sudo: yes + tasks: + - new_rabbitmq_vhost: name={{vhost_name}} + node={{container_name}} + state=present + rabbitmqctl="docker exec -it {{container_name}} rabbitmqctl" diff --git a/resources/rabbitmq_vhost/meta.yaml b/resources/rabbitmq_vhost/meta.yaml new file mode 100644 index 0000000..f8ecf4f --- /dev/null +++ b/resources/rabbitmq_vhost/meta.yaml @@ -0,0 +1,21 @@ +id: rabbitmq_vhost +handler: ansible +version: 1.0.0 +input: + container_name: + schema: str! + value: + vhost_name: + schema: str! + value: + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: + +tags: [resource/rabbitmq]