From 59d9be694aa4490ca70717a29b7e390cd139b1b1 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Wed, 11 Apr 2018 11:47:50 +0200 Subject: [PATCH] Add openvswitch/hugetlbfs user and group on update When we bring ovs 2.9 we will need to have openvswitch user and hugetlbfs group, in order for ovs to work properly. As the package is not taking care of it, create it on the update tasks. Co-Authored-By: Zenghui Shi Change-Id: I792dd0e1cac1782499413f01b5d40d3b338fd5b1 --- puppet/services/neutron-ovs-agent.yaml | 2 ++ puppet/services/neutron-ovs-dpdk-agent.yaml | 2 ++ puppet/services/opendaylight-ovs.yaml | 2 ++ puppet/services/openvswitch.yaml | 24 +++++++++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/puppet/services/neutron-ovs-agent.yaml b/puppet/services/neutron-ovs-agent.yaml index 9f9aa86d55..f748773207 100644 --- a/puppet/services/neutron-ovs-agent.yaml +++ b/puppet/services/neutron-ovs-agent.yaml @@ -153,6 +153,8 @@ outputs: - neutron::agents::ml2::ovs::firewall_driver: {get_param: NeutronOVSFirewallDriver} step_config: | include ::tripleo::profile::base::neutron::ovs + update_tasks: + get_attr: [Ovs, role_data, update_tasks] upgrade_tasks: list_concat: - get_attr: [Ovs, role_data, upgrade_tasks] diff --git a/puppet/services/neutron-ovs-dpdk-agent.yaml b/puppet/services/neutron-ovs-dpdk-agent.yaml index 4f5eecca04..b938db6d12 100644 --- a/puppet/services/neutron-ovs-dpdk-agent.yaml +++ b/puppet/services/neutron-ovs-dpdk-agent.yaml @@ -94,5 +94,7 @@ outputs: - get_attr: [Ovs, role_data, config_settings] - get_attr: [RoleParametersValue, value] step_config: {get_attr: [NeutronOvsAgent, role_data, step_config]} + update_tasks: + get_attr: [Ovs, role_data, update_tasks] upgrade_tasks: get_attr: [Ovs, role_data, upgrade_tasks] diff --git a/puppet/services/opendaylight-ovs.yaml b/puppet/services/opendaylight-ovs.yaml index c1cec4ff41..3986a0c6dd 100644 --- a/puppet/services/opendaylight-ovs.yaml +++ b/puppet/services/opendaylight-ovs.yaml @@ -140,6 +140,8 @@ outputs: - get_attr: [RoleParametersValue, value] step_config: | include tripleo::profile::base::neutron::plugins::ovs::opendaylight + update_tasks: + get_attr: [Ovs, role_data, update_tasks] upgrade_tasks: list_concat: - get_attr: [Ovs, role_data, upgrade_tasks] diff --git a/puppet/services/openvswitch.yaml b/puppet/services/openvswitch.yaml index 6479d7f9c8..57345ab885 100644 --- a/puppet/services/openvswitch.yaml +++ b/puppet/services/openvswitch.yaml @@ -140,6 +140,30 @@ outputs: OvsDpdkDriverType: {if: [driver_not_set, {get_param: NeutronDpdkDriverType}, {get_param: OvsDpdkDriverType}]} OvsPmdCoreList: {if: [pmd_cores_empty, {get_param: NeutronDpdkCoreList}, {get_param: OvsPmdCoreList}]} + update_tasks: + # Ovs uses openvswitch:hugetlbfs as user and group settings + # when updating to 2.8 onwards, but openvswitch user is not + # created during package update. This adds workaround to + # make sure openvswitch user exist before running package + # update. Details can be found at: + # https://bugzilla.redhat.com/show_bug.cgi?id=1559374 + # 42477 is the kolla hugetlbfs gid value. + - name: ensure hugetlbfs group is present + when: step == "2" + group: + name: hugetlbfs + gid: 42477 + + - name: ensure openvswitch user is present on the host + when: step == "2" + user: + name: openvswitch + home: / + system: yes + groups: hugetlbfs + shell: /sbin/nologin + comment: "OpenvSwitch Daemons" + upgrade_tasks: - name: Check openvswitch version. tags: step2