kayobe/ansible/roles/console-allocation/tasks/main.yml
Mark Goddard b9d76f6ef5 Remove support for CentOS 7 and Python 2
* Always use Python 3
* Drop code paths for CentOS 7
* Drop support for Yum
* Remove support for host NTP daemon, always use chrony
* Switch references from 'yum_install_epel' to 'dnf_install_epel'
* Remove overcloud host image workaround for tagged VLAN admin network
* Remove the kayobe.utils.yum_install function, which is unused

Change-Id: I368f6edafed9779658798fc342116b4c1b3ffd48
Story: 2006574
Task: 39481
2020-05-28 10:25:51 +01:00

49 lines
1.7 KiB
YAML

---
- name: Validate allocation pool start
vars:
port: "{{ console_allocation_pool_start | int(default=-1) }}"
fail:
msg: >-
You must must define an console_allocation_pool_start. This should
be a valid TCP port.
when: >-
console_allocation_pool_end is none or
port | int < 0 or port | int > 65535
- name: Validate allocation pool end
vars:
port: "{{ console_allocation_pool_end | int(default=-1) }}"
fail:
msg: >-
You must must define an console_allocation_pool_end. This should
be a valid TCP port.
when: >-
console_allocation_pool_end is none or
port | int < 0 or port | int > 65535
- name: Validate that allocation start is less than allocation end
fail:
msg: >-
console_allocation_start and console_allocation_end define a range
of TCP ports. You have defined a range with a start that is less than
the end
when:
- (console_allocation_pool_start | int) > (console_allocation_pool_end | int)
- name: Ensure Ironic serial console ports are allocated
vars:
# NOTE(mgoddard): Use the Python interpreter used to run ansible-playbook,
# since this has Python dependencies available to it (PyYAML).
ansible_python_interpreter: "{{ ansible_playbook_python }}"
local_action:
module: console_allocation
allocation_file: "{{ console_allocation_filename }}"
nodes: "{{ console_allocation_ironic_nodes }}"
allocation_pool_start: "{{ console_allocation_pool_start }}"
allocation_pool_end: "{{ console_allocation_pool_end }}"
register: result
- name: Register a fact containing the console allocation result
set_fact:
console_allocation_result: "{{ result }}"