diff --git a/defaults/main.yml b/defaults/main.yml index 76dd0ab0..aeb65aea 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,8 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -openstack_code_name: Ocata -openstack_release: master +# /etc/openstack-release settings +openstack_distrib_id: "OSA" +openstack_distrib_release: "{{ openstack_release | default('master') }}" +openstack_distrib_code_name: "Ocata" +openstack_distrib_description: "OpenStack-Ansible" +openstack_distrib_file: yes +openstack_distrib_file_path: "/etc/openstack-release" openstack_host_sysstat_enabled: true openstack_host_sysstat_interval: 1 diff --git a/releasenotes/notes/openstack-release-file-changes-ef4b28d46378fd7a.yaml b/releasenotes/notes/openstack-release-file-changes-ef4b28d46378fd7a.yaml new file mode 100644 index 00000000..fe78afdf --- /dev/null +++ b/releasenotes/notes/openstack-release-file-changes-ef4b28d46378fd7a.yaml @@ -0,0 +1,19 @@ +--- +features: + - The copy of the ``/etc/openstack-release`` file is now optional. + To disable the copy of the file, set ``openstack_distrib_file`` + to ``no``. + - The location of the ``/etc/openstack-release`` file placement + can now be changed. Set the variable ``openstack_distrib_file_path`` + to place it in a different path. +upgrade: + - | + The variables used to produce the ``/etc/openstack-release`` file + have been changed in order to improve consistency in the name + spacing according to their purpose. + + ``openstack_code_name`` --> ``openstack_distrib_code_name`` + ``openstack_release`` --> ``openstack_distrib_release`` + + Note that the value for ``openstack_distrib_release`` will + be taken from the variable ``openstack_release`` if it is set. diff --git a/tasks/openstack_release.yml b/tasks/openstack_release.yml index 0d386f6e..19429ca4 100644 --- a/tasks/openstack_release.yml +++ b/tasks/openstack_release.yml @@ -16,6 +16,13 @@ - name: Drop openstack release file template: src: "openstack-release.j2" - dest: "/etc/openstack-release" + dest: "{{ openstack_distrib_file_path }}" owner: "root" group: "root" + when: openstack_distrib_file | bool + +- name: Remove legacy openstack release file + file: + path: "{{ openstack_distrib_file_path }}" + state: absent + when: not openstack_distrib_file | bool diff --git a/templates/openstack-release.j2 b/templates/openstack-release.j2 index 3a200fa2..c3bd7e14 100644 --- a/templates/openstack-release.j2 +++ b/templates/openstack-release.j2 @@ -1,6 +1,6 @@ # {{ ansible_managed }} -DISTRIB_ID="OSA" -DISTRIB_RELEASE="{{ openstack_release }}" -DISTRIB_CODENAME="{{ openstack_code_name }}" -DISTRIB_DESCRIPTION="OpenStack-Ansible" +DISTRIB_ID="{{ openstack_distrib_id }}" +DISTRIB_RELEASE="{{ openstack_distrib_release }}" +DISTRIB_CODENAME="{{ openstack_distrib_code_name }}" +DISTRIB_DESCRIPTION="{{ openstack_distrib_description }}"