update
This commit is contained in:
parent
ae3778c57c
commit
d2cb2d0280
2
.gitignore
vendored
2
.gitignore
vendored
@ -17,3 +17,5 @@ tmp
|
|||||||
.idea/**
|
.idea/**
|
||||||
*/.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
|
namespace: opentelekomcloud
|
||||||
name: backend
|
name: backend
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
readme: README.rst
|
readme: README.md
|
||||||
authors:
|
authors:
|
||||||
- Artem Goncharov (@gtema)
|
- 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(
|
def process(
|
||||||
self,
|
self,
|
||||||
target_data,
|
services,
|
||||||
target_env='production',
|
target_env='production',
|
||||||
dry_run=True,
|
dry_run=True,
|
||||||
skip_delete=True,
|
skip_delete=True,
|
||||||
@ -158,8 +158,7 @@ class ServiceCatalogModule(OTCModule):
|
|||||||
_used_services = set()
|
_used_services = set()
|
||||||
_used_eps = set()
|
_used_eps = set()
|
||||||
results = dict(services=[], endpoints=[])
|
results = dict(services=[], endpoints=[])
|
||||||
for srv_type, target_srv in target_data.get(
|
for srv_type, target_srv in services.items():
|
||||||
'services', {}).items():
|
|
||||||
if limit_services is not None and srv_type not in limit_services:
|
if limit_services is not None and srv_type not in limit_services:
|
||||||
# logging.debug(f'Skipping service {srv_type} as requested')
|
# logging.debug(f'Skipping service {srv_type} as requested')
|
||||||
continue
|
continue
|
||||||
@ -319,15 +318,15 @@ class ServiceCatalogModule(OTCModule):
|
|||||||
def run(self):
|
def run(self):
|
||||||
changed = False
|
changed = False
|
||||||
(results, changed) = self.process(
|
(results, changed) = self.process(
|
||||||
target_data=self.params['services'],
|
services=self.params['services'],
|
||||||
target_env=['self.args.environment'],
|
target_env=self.params['environment'],
|
||||||
dry_run=self.ansible.check_mode,
|
dry_run=self.ansible.check_mode,
|
||||||
limit_services=self.params['limit_services']
|
limit_services=self.params['limit_services']
|
||||||
)
|
)
|
||||||
if len(self.errors) == 0:
|
if len(self.errors) == 0:
|
||||||
self.exit_json(
|
self.exit_json(
|
||||||
changed=changed,
|
changed=changed,
|
||||||
results=results
|
changes=results
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.fail_json(
|
self.fail_json(
|
||||||
|
@ -1,19 +1,12 @@
|
|||||||
---
|
---
|
||||||
- ansible.builtin.set_fact:
|
- name: include vars
|
||||||
services:
|
ansible.builtin.include_vars:
|
||||||
compute:
|
file: test_data.yaml
|
||||||
name: "nova"
|
name: "config"
|
||||||
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: Check run
|
- name: Check run
|
||||||
opentelekomcloud.backend.service_catalog:
|
opentelekomcloud.backend.service_catalog:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
environment: "production"
|
environment: "production"
|
||||||
services: "{{ services }}"
|
services: "{{ config.services }}"
|
||||||
check_mode: true
|
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