Hi, We have an OSA setup. During a service playbook, for example, say rabbitmq, which task or play is responsible for creating it's haproxy configuration ? I mean, where is the code in openstack ansible to say to gather the values from user_variables file for that particular service or gather it from conf.d ? For instance, for rabbitmq service, where is the code which says to get the rabbitmq management port for the backend to be 15671 ? I mean where is the source code for pulling it from user_variables file and also which variable from it ?
Hey, This depends on the OpenStack-Ansible version. Since 2023.1 we have moved haproxy configuration to individual service playbooks from haproxy one. So if you're running 2023.1 (Antelope) or later - this code can be found in /opt/openstack-ansible/inventory/group_vars/<service_group>/haproxy_service.yml For RabbitMQ specifically it's just slightly different (we should probably align on that) and is on level above[1]. Once haproxy config is changed, you need to run service playbook with "haproxy-service-config" tag in order to apply changes, for instance: openstack-ansible playbooks/rabbitmq-install.yml --tags rabbitmq-install.yml If you're running Zed or earlier, these vars are defined for the haproxy group, in /opt/openstack-ansible/inventory/group_vars/haproxy/haproxy.yml [2]. And then you'd need to run haproxy-install.yml playbook, which manages all backends at once. [1] https://opendev.org/openstack/openstack-ansible/src/commit/9cd05a5f5b206bbef... [2] https://opendev.org/openstack/openstack-ansible/src/commit/b953776f4a553a978... вт, 27 февр. 2024 г. в 19:23, Gk Gk <ygk.kmr@gmail.com>:
Hi,
We have an OSA setup. During a service playbook, for example, say rabbitmq, which task or play is responsible for creating it's haproxy configuration ? I mean, where is the code in openstack ansible to say to gather the values from user_variables file for that particular service or gather it from conf.d ? For instance, for rabbitmq service, where is the code which says to get the rabbitmq management port for the backend to be 15671 ? I mean where is the source code for pulling it from user_variables file and also which variable from it ?
Hi, I already answered a very similar question you asked about the repo_server component here https://lists.openstack.org/archives/list/openstack-discuss@lists.openstack.... Any files that you have in /etc/openstack_deploy/user_*.yml are treated as "extra variables" by ansible. * See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.h... These extra vars files are appended automatically to the ansible-playbook command when you use the openstack-ansible wrapper script. * See https://github.com/openstack/openstack-ansible/blob/master/scripts/openstack... For your specific query on rabbitmq, the parameters for the managment port are defined in the rabbitmq_server role defaults. * See https://github.com/openstack/openstack-ansible-rabbitmq_server/blob/master/d... There is no code to "pull it" from user variables. What is happening here is the normal rules of ansible variable precedence. * See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.h... If there is no variable defined in your deployment with a higher precedence than the rabbitmq_server role default for "rabbitmq_management_bind_tls_port", then the default will be taken from there. If you wish to customise this setting you can place an override value in any of the standard locations for Ansible, like group_vars/ or host_vars/, or add it as a maximum-precedence override in one of your openstack_deploy/user_*.yml files. If it would be helpful to discuss any of this more interactively then please do join the #openstack-ansible IRC channel and we can try to help. * See https://docs.openstack.org/contributors/common/irc.html Jonathan. On 27/02/2024 18:18, Gk Gk wrote:
Hi,
We have an OSA setup. During a service playbook, for example, say rabbitmq, which task or play is responsible for creating it's haproxy configuration ? I mean, where is the code in openstack ansible to say to gather the values from user_variables file for that particular service or gather it from conf.d ? For instance, for rabbitmq service, where is the code which says to get the rabbitmq management port for the backend to be 15671 ? I mean where is the source code for pulling it from user_variables file and also which variable from it ?
participants (3)
-
Dmitriy Rabotyagov
-
Gk Gk
-
Jonathan Rosser