update
This commit is contained in:
parent
ae3778c57c
commit
d2cb2d0280
2
.gitignore
vendored
2
.gitignore
vendored
@ -17,3 +17,5 @@ tmp
|
||||
.idea/**
|
||||
*/.idea/**
|
||||
|
||||
tests/output
|
||||
tests/*/inventory
|
||||
|
4
README.md
Normal file
4
README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Open Telekom Cloud Backend collectio
|
||||
|
||||
This is a collection of useful content helping to operate Open Telekom Cloud
|
||||
backend
|
@ -2,7 +2,7 @@
|
||||
namespace: opentelekomcloud
|
||||
name: backend
|
||||
version: 0.1.0
|
||||
readme: README.rst
|
||||
readme: README.md
|
||||
authors:
|
||||
- Artem Goncharov (@gtema)
|
||||
|
||||
|
2
meta/runtime.yml
Normal file
2
meta/runtime.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
requires_ansible: '>=2.9.10'
|
@ -144,7 +144,7 @@ class ServiceCatalogModule(OTCModule):
|
||||
|
||||
def process(
|
||||
self,
|
||||
target_data,
|
||||
services,
|
||||
target_env='production',
|
||||
dry_run=True,
|
||||
skip_delete=True,
|
||||
@ -158,8 +158,7 @@ class ServiceCatalogModule(OTCModule):
|
||||
_used_services = set()
|
||||
_used_eps = set()
|
||||
results = dict(services=[], endpoints=[])
|
||||
for srv_type, target_srv in target_data.get(
|
||||
'services', {}).items():
|
||||
for srv_type, target_srv in services.items():
|
||||
if limit_services is not None and srv_type not in limit_services:
|
||||
# logging.debug(f'Skipping service {srv_type} as requested')
|
||||
continue
|
||||
@ -319,15 +318,15 @@ class ServiceCatalogModule(OTCModule):
|
||||
def run(self):
|
||||
changed = False
|
||||
(results, changed) = self.process(
|
||||
target_data=self.params['services'],
|
||||
target_env=['self.args.environment'],
|
||||
services=self.params['services'],
|
||||
target_env=self.params['environment'],
|
||||
dry_run=self.ansible.check_mode,
|
||||
limit_services=self.params['limit_services']
|
||||
)
|
||||
if len(self.errors) == 0:
|
||||
self.exit_json(
|
||||
changed=changed,
|
||||
results=results
|
||||
changes=results
|
||||
)
|
||||
else:
|
||||
self.fail_json(
|
||||
|
@ -1,19 +1,12 @@
|
||||
---
|
||||
- ansible.builtin.set_fact:
|
||||
services:
|
||||
compute:
|
||||
name: "nova"
|
||||
environments:
|
||||
production:
|
||||
endpoints:
|
||||
eu-de:
|
||||
- url: "https://ecs.eu-de.otc.t-systems.com/v2.1/$(tenant_id)s"
|
||||
eu-nl:
|
||||
- url: "https://ecs.eu-nl.otc.t-systems.com/v2.1/$(tenant_id)s"
|
||||
- name: include vars
|
||||
ansible.builtin.include_vars:
|
||||
file: test_data.yaml
|
||||
name: "config"
|
||||
|
||||
- name: Check run
|
||||
opentelekomcloud.backend.service_catalog:
|
||||
cloud: "{{ cloud }}"
|
||||
environment: "production"
|
||||
services: "{{ services }}"
|
||||
services: "{{ config.services }}"
|
||||
check_mode: true
|
||||
|
@ -0,0 +1,17 @@
|
||||
---
|
||||
services:
|
||||
# Key of the dictionary is the service type
|
||||
# this helps avoiding duplication of the services
|
||||
compute:
|
||||
name: "nova"
|
||||
environments:
|
||||
production:
|
||||
endpoints:
|
||||
eu-de:
|
||||
- url: "https://ecs.eu-de.otc.t-systems.com/v2.1/$(tenant_id)s"
|
||||
eu-nl:
|
||||
- url: "https://ecs.eu-nl.otc.t-systems.com/v2.1/$(tenant_id)s"
|
||||
preprod:
|
||||
endpoints:
|
||||
eu-de:
|
||||
- url: "https://ecs.eu-de.otctest.t-systems.com/v2.1/$(tenant_id)s"
|
Loading…
x
Reference in New Issue
Block a user