diff --git a/resources/keystone_puppet/actions/remove.pp b/resources/keystone_puppet/actions/remove.pp new file mode 100644 index 0000000..958de8c --- /dev/null +++ b/resources/keystone_puppet/actions/remove.pp @@ -0,0 +1,4 @@ +class {'keystone': + admin_token => '{{ admin_token }}', + package_ensure => 'absent' +} diff --git a/resources/keystone_puppet/actions/run.pp b/resources/keystone_puppet/actions/run.pp new file mode 100644 index 0000000..0ece835 --- /dev/null +++ b/resources/keystone_puppet/actions/run.pp @@ -0,0 +1,25 @@ +$resource = hiera('{{ resource_name }}') + +$ip = $resource['input']['ip']['value'] +$admin_token = $resource['input']['admin_token']['value'] +$db_user = $resource['input']['db_user']['value'] +$db_password = $resource['input']['db_password']['value'] +$db_name = $resource['input']['db_name']['value'] +$admin_port = $resource['input']['admin_port']['value'] +$port = $resource['input']['port']['value'] + +class {'keystone': + package_ensure => 'present', + verbose => True, + catalog_type => 'sql', + admin_token => $admin_token, + database_connection => "mysql://$db_user:$db_password@$ip/$db_name", + public_port => "$port", + token_driver => 'keystone.token.backends.kvs.Token' +} + +#file { '/etc/keystone/keystone-exports': +# owner => 'root', +# group => 'root', +# content => template('keystone/exports.erb') +#} diff --git a/resources/keystone_puppet/actions/update.pp b/resources/keystone_puppet/actions/update.pp new file mode 100644 index 0000000..eb2ef64 --- /dev/null +++ b/resources/keystone_puppet/actions/update.pp @@ -0,0 +1,7 @@ +class {'keystone': + verbose => True, + catalog_type => 'sql', + admin_token => '{{ admin_token }}', + sql_connection => 'mysql://{{ db_user }}:{{ db_password }}@{{ ip }}/{{ db_name }}', + public_port => '{{ port }}' +} diff --git a/resources/keystone_puppet/meta.yaml b/resources/keystone_puppet/meta.yaml new file mode 100644 index 0000000..e55a905 --- /dev/null +++ b/resources/keystone_puppet/meta.yaml @@ -0,0 +1,44 @@ +id: keystone_puppet +handler: puppet +puppet_module: keystone +version: 1.0.0 +input: + admin_token: + schema: str! + value: admin_token + db_user: + schema: str! + value: keystone + db_password: + schema: str! + value: keystone + db_name: + schema: str! + value: keystone + + admin_port: + schema: int! + value: 35357 + port: + schema: int! + value: 5000 + + git: + schema: {repository: str!, branch: str!} + value: {repository: 'https://github.com/openstack/puppet-keystone', branch: 'stable/juno'} + +# forge: +# schema: str! +# value: 'stackforge-keystone' + + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: + +tags: [resource/keystone_service, resources/keystone]