diff --git a/doc/source/developer-docs/additional-roles.rst b/doc/source/developer-docs/additional-roles.rst index 876d2761ce..04929295ce 100644 --- a/doc/source/developer-docs/additional-roles.rst +++ b/doc/source/developer-docs/additional-roles.rst @@ -152,11 +152,12 @@ Deploying the role run the ``repo-build.yml`` play later so that wheels for your packages will be included in the repository infrastructure. #. Make any required adjustments to the load balancer configuration - (e.g. modify ``playbooks/vars/configs/haproxy_config.yml`` in the + (e.g. modify ``playbooks/inventory/group_vars/all/haproxy.yml`` in the OpenStack-Ansible source repository on your deploy host) so that your service can be reached through a load balancer, if appropriate, and be sure to run the ``haproxy-install.yml`` play later so your changes will be - applied. + applied. Please note, you can also use ``haproxy_extra_services`` variable + if you don't want to provide your service as default for everyone. #. Put together a service install playbook file for your role. This can also be modeled from any existing service playbook that has similar dependencies to your service (database, messaging, storage drivers, diff --git a/etc/openstack_deploy/openstack_user_config.yml.example b/etc/openstack_deploy/openstack_user_config.yml.example index f8197e2cd4..1e60a84457 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.example +++ b/etc/openstack_deploy/openstack_user_config.yml.example @@ -720,18 +720,15 @@ # Edit the ``/etc/openstack_deploy/user_variables.yml``: # keepalived_use_latest_stable: True # -# The HAProxy playbook reads the ``vars/configs/keepalived_haproxy.yml`` -# variable file and provides content to the keepalived role for -# keepalived master and backup nodes. +# The group_vars/all/keepalived.yml contains the keepalived +# variables that are fed into the keepalived role during +# the haproxy playbook. +# You can change the keepalived behavior for your +# deployment. Refer to the ``user_variables.yml`` file for +# more information. # # Keepalived pings a public IP address to check its status. The default # address is ``193.0.14.129``. To change this default, # set the ``keepalived_ping_address`` variable in the # ``user_variables.yml`` file. -# -# You can define additional variables to adapt keepalived to your -# deployment. Refer to the ``user_variables.yml`` file for -# more information. Optionally, you can use your own variable file. -# For example: -# haproxy_keepalived_vars_file: /path/to/myvariablefile.yml -# + diff --git a/etc/openstack_deploy/user_variables.yml b/etc/openstack_deploy/user_variables.yml index b424d531b3..da81c95799 100644 --- a/etc/openstack_deploy/user_variables.yml +++ b/etc/openstack_deploy/user_variables.yml @@ -142,7 +142,11 @@ debug: false #ssh_delay: 5 -## HAProxy +## HAProxy and keepalived +# All the previous variables are used inside a var, in the group vars. +# You can override the current keepalived definition (see +# group_vars/all/keepalived.yml) in your user space if necessary. +# # Uncomment this to disable keepalived installation (cf. documentation) # haproxy_use_keepalived: False # @@ -167,7 +171,3 @@ debug: false # Keepalived default IP address used to check its alive status (IPv4 only) # keepalived_ping_address: "193.0.14.129" - -# All the previous variables are used in a var file, fed to the keepalived role. -# To use another file to feed the role, override the following var: -# haproxy_keepalived_vars_file: 'vars/configs/keepalived_haproxy.yml' diff --git a/playbooks/haproxy-install.yml b/playbooks/haproxy-install.yml index ba5555596b..9b69053e00 100644 --- a/playbooks/haproxy-install.yml +++ b/playbooks/haproxy-install.yml @@ -29,8 +29,6 @@ when: haproxy_use_keepalived | bool tags: - keepalived - vars_files: - - "{{ haproxy_keepalived_vars_file | default('vars/configs/keepalived_haproxy.yml') }}" vars: is_metal: "{{ properties.is_metal|default(false) }}" environment: "{{ deployment_environment_variables | default({}) }}" @@ -70,8 +68,6 @@ - rsyslog post_tasks: - include: common-tasks/package-cache-proxy.yml - vars_files: - - vars/configs/haproxy_config.yml vars: is_metal: "{{ properties.is_metal|default(false) }}" environment: "{{ deployment_environment_variables | default({}) }}" diff --git a/playbooks/vars/configs/haproxy_config.yml b/playbooks/inventory/group_vars/all/haproxy.yml similarity index 100% rename from playbooks/vars/configs/haproxy_config.yml rename to playbooks/inventory/group_vars/all/haproxy.yml diff --git a/playbooks/vars/configs/keepalived_haproxy.yml b/playbooks/inventory/group_vars/all/keepalived.yml similarity index 97% rename from playbooks/vars/configs/keepalived_haproxy.yml rename to playbooks/inventory/group_vars/all/keepalived.yml index 26b0e1aa7a..d1c49bee36 100644 --- a/playbooks/vars/configs/keepalived_haproxy.yml +++ b/playbooks/inventory/group_vars/all/keepalived.yml @@ -27,7 +27,7 @@ keepalived_sync_groups: ##if a src_*_script is defined, it will be uploaded from src_*_script ##on the deploy host to the *_script location. Make sure *_script is ##a location in that case. - src_notify_script: vars/configs/keepalived_haproxy_notifications.sh + src_notify_script: "{{ playbook_dir }}/../scripts/keepalived_haproxy_notifications.sh" keepalived_scripts: haproxy_check_script: diff --git a/releasenotes/notes/keepalived-cleanup-d25a27752c0432bc.yaml b/releasenotes/notes/keepalived-cleanup-d25a27752c0432bc.yaml new file mode 100644 index 0000000000..e8402ed390 --- /dev/null +++ b/releasenotes/notes/keepalived-cleanup-d25a27752c0432bc.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + If you had your own keepalived configuration file, please rename and + move it to the openstack-ansible user space, for example by moving + it to ```/etc/openstack_deploy/keepalived/keepalived.yml```. + Our haproxy playbook does not load an external variable files anymore. + The keepalived variable override system has been standardised to the + same method used elsewhere. diff --git a/playbooks/vars/configs/keepalived_haproxy_notifications.sh b/scripts/keepalived_haproxy_notifications.sh similarity index 100% rename from playbooks/vars/configs/keepalived_haproxy_notifications.sh rename to scripts/keepalived_haproxy_notifications.sh