1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Enea AB and others.
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Charalampos Kominos <Charalampos.Kominos@enea.com>
10 Date: Fri, 1 Sep 2017 12:24:35 +0200
11 Subject: [PATCH] Add opnfv user to the deployment
13 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
14 Signed-off-by: Charalampos Kominos <Charalampos.Kominos@enea.com>
15 Signed-off-by: Guillermo Herrero <Guillermo.Herrero@enea.com>
17 mcp/config/states/virtual_control_plane | 2 ++
18 mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml | 4 ++++
19 mcp/salt-formulas/opnfv/adduser.sls | 7 +++++++
20 3 files changed, 13 insertions(+)
21 create mode 100644 mcp/salt-formulas/opnfv/adduser.sls
23 diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane
24 index ec1cd00..7746bac 100755
25 --- a/mcp/config/states/virtual_control_plane
26 +++ b/mcp/config/states/virtual_control_plane
27 @@ -18,6 +18,7 @@ salt -C 'kvm* or cmp*' file.line \
28 /usr/lib/python2.7/dist-packages/salt/modules/debian_ip.py \
29 content='iface = iface.lower()' mode='delete'
30 salt -C 'kvm*' pkg.install bridge-utils
31 +salt -C '*' state.apply opnfv.adduser
32 salt -C 'kvm*' state.apply linux.network
33 salt -C 'cmp*' state.apply linux.system
34 salt -C 'cmp*' state.apply linux.network || true
35 @@ -48,6 +49,7 @@ while [ $rc -ne 0 ] && [ ${attempt} -lt ${total_attempts} ]; do
37 for node in $vcp_nodes; do
38 salt "$node" test.ping 2>/dev/null || { rc=$?; break; };
39 + salt -C "$node" state.apply opnfv.adduser
43 diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml
44 index aa780e6..e4069c0 100644
45 --- a/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml
46 +++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/init.yml
49 - cluster.all-mcp-ocata-common.opnfv.runtime
50 - cluster.all-mcp-ocata-common.opnfv.pod_config
53 + opnfv_user_username: opnfv
54 + opnfv_user_password: $1$5/pIEHT1$XFBhNWW4Q8gYd19hczgPF1
55 diff --git a/mcp/salt-formulas/opnfv/adduser.sls b/mcp/salt-formulas/opnfv/adduser.sls
57 index 0000000..78ef993
59 +++ b/mcp/salt-formulas/opnfv/adduser.sls
63 + - name: {{ salt['pillar.get']('_param:opnfv_user_username') }}
64 + - password: {{ salt['pillar.get']('_param:opnfv_user_password') }}