Allow an fqdn extension to be specified for MaaS purposes

This allows the inventory_hostname to be specified as the shortname, and
a common fqdn to applied. E.g. infra01 with an fqdn of .test.com would
count towards a MaaS entity of infra01.test.com whilst the inventory for
ansible would still see it as "infra01".
This commit is contained in:
Andy McCrae 2014-09-11 17:48:53 +01:00
parent ff0d6e5b6a
commit 4085c5342d
4 changed files with 7 additions and 4 deletions

View File

@ -112,7 +112,10 @@ maas_monitoring_zones:
- mzlon - mzlon
- mzhkg - mzhkg
maas_repo_version: v9.0.0 maas_repo_version: v9.0.0
# Specify the maas_fqdn_extension, defaults to empty string.
# This will be appended to the inventory_name of a host for MaaS purposes.
# The inventory name + maas_fqdn_extension must match the entity name in MaaS
# maas_fqdn_extension: .example.com
## Neutron Options ## Neutron Options
neutron_container_mysql_password: neutron_container_mysql_password:

View File

@ -20,7 +20,7 @@
- raxmon_cli - raxmon_cli
- raxmon_agent_install - raxmon_agent_install
vars: vars:
entity_name: "{{ inventory_hostname }}" entity_name: "{{ inventory_hostname }}{{ maas_fqdn_extension|default('') }}"
- hosts: keystone[0] - hosts: keystone[0]
user: root user: root

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
- name: Get entity ID for physical_host - name: Get entity ID for physical_host
shell: raxmon-entities-list | grep "label={{ inventory_hostname|quote }} " | sed -e 's/^.* id=\(.*\) label=.*$/\1/g' shell: raxmon-entities-list | grep "label={{ inventory_hostname|quote }}{{ maas_fqdn_extension|default('') }} " | sed -e 's/^.* id=\(.*\) label=.*$/\1/g'
register: entity_id register: entity_id
- name: Validate if check exists - name: Validate if check exists

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
- name: Get entity ID for physical_host - name: Get entity ID for physical_host
shell: raxmon-entities-list | grep "label={{ physical_host|quote }} " | sed -e 's/^.* id=\(.*\) label=.*$/\1/g' shell: raxmon-entities-list | grep "label={{ physical_host|quote }}{{ maas_fqdn_extension|default('') }} " | sed -e 's/^.* id=\(.*\) label=.*$/\1/g'
register: entity_id register: entity_id
delegate_to: "{{ physical_host }}" delegate_to: "{{ physical_host }}"