fixed ansible-lint errors

This commit is contained in:
milkmix 2019-05-03 17:06:22 +02:00
parent 439501da18
commit f4efa37264
2 changed files with 9 additions and 15 deletions

View file

@ -3,14 +3,14 @@
- name: Build python virtual environment
import_tasks: venv.yml
- name: Include prompts
import_tasks: prompts.yml
- block:
- name: Include prompts
import_tasks: prompts.yml
- set_fact:
algo_region: >-
{% if region is defined %}{{ region }}
{%- elif _algo_region.user_input is defined and _algo_region.user_input != "" %}{{ cs_zones[_algo_region.user_input | int -1 ]['name'] }}
{%- elif _algo_region.user_input is defined and _algo_region.user_input | length > 0 %}{{ cs_zones[_algo_region.user_input | int -1 ]['name'] }}
{%- else %}{{ cs_zones[default_zone | int - 1]['name'] }}{% endif %}
- name: Security group created
@ -62,7 +62,7 @@
environment:
PYTHONPATH: "{{ cloudstack_venv }}/lib/python2.7/site-packages/"
CLOUDSTACK_CONFIG: "{{ _cs_config }}"
CLOUDSTACK_REGION: "{% if _cs_region.user_input == '' %}{{ 'exoscale' }}{% else %}{{ _cs_region.user_input }}{% endif %}"
CLOUDSTACK_REGION: "{% if _cs_region.user_input | length <= 0 %}{{ 'exoscale' }}{% else %}{{ _cs_region.user_input }}{% endif %}"
rescue:
- debug: var=fail_hint

View file

@ -1,21 +1,15 @@
---
- block:
- set_fact:
_cs_config: "{{ lookup('env', 'CLOUDSTACK_CONFIG') }}"
- pause:
prompt: |
Enter path for cloudstack.ini file
[~/.cloudstack.ini]
register: _cs_config_input
when: _cs_config == ""
when:
- lookup('env', 'CLOUDSTACK_CONFIG') | length <= 0
- set_fact:
_cs_config_input: "{% if _cs_config_input.user_input == ''%}{{ '~/.cloudstack.ini' }}{% else %}{{ _cs_config_input.user_input }}{% endif %}"
when: _cs_config == ""
- set_fact:
_cs_config: "{% if _cs_config == '' %}{{ _cs_config_input }}{% else %}{{ _cs_config }}{% endif %}"
_cs_config: "{{ _cs_config_input.user_input | default(lookup('env', 'CLOUDSTACK_CONFIG'), true) | default('~/.cloudstack.ini') }}"
- pause:
prompt: |
@ -26,7 +20,7 @@
- name: Parse zones from output
set_fact:
_cs_zones: "{{ _cloudstack_zones | from_json }}"
- name: Extract zones from output
set_fact:
cs_zones: "{{ _cs_zones | sort(attribute='name') }}"