34db789a2254fb3840cacc0338feaf625d62dd67
[fuel.git] / mcp / patches / docker / 0003-OPNFV-package-installation-Ubuntu-user.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2019 Mirantis Inc., Enea AB and others.
3 :
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: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Wed, 22 Aug 2018 01:35:06 +0200
11 Subject: [PATCH] OPNFV package installation, Ubuntu user
12
13 * Install OpenSSH server (and client), so other OPNFV projects can
14   easily connect to the Salt master node;
15 * Install 'salt-formula-gnocchi' distro package (empty git formula
16   workaround);
17 * While at it, create 'ubuntu' user so other OPNFV projects don't
18   have to switch to 'root' login;
19 * Preinstall `salt_minion_dependency_packages` and
20   `salt_minion_reclass_dependencies`;
21
22 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
23 ---
24  DockerMake.yml | 38 +++++++++++++++++++++++++++++++++++++-
25  1 file changed, 37 insertions(+), 1 deletion(-)
26
27 diff --git a/DockerMake.yml b/DockerMake.yml
28 index 2c75586..9ab7195 100644
29 --- a/DockerMake.yml
30 +++ b/DockerMake.yml
31 @@ -29,6 +29,7 @@ common-cleanup:
32
33  common:
34    build: |
35 +    ARG CACHE_INVALIDATE="0"
36      RUN echo "Layer with common packages" \
37        && eval ${LAYER_PKGUPDT} \
38        && apt-get upgrade -qy \
39 @@ -94,7 +95,7 @@ salt-formulas:
40    build: |
41      ARG SALT_FORMULA_VERSION="master"
42      ENV SALT_FORMULA_VERSION $SALT_FORMULA_VERSION
43 -    ARG SALT_FORMULA_SOURCES="https://github.com/salt-formulas https://github.com/saltstack-formulas"
44 +    ARG SALT_FORMULA_SOURCES="https://github.com/salt-formulas"
45      ENV SALT_FORMULA_SOURCES $SALT_FORMULA_SOURCES
46      ARG SALT_FORMULAS_BASE="/srv/salt/formula"
47      ENV SALT_FORMULAS_BASE $SALT_FORMULAS_BASE
48 @@ -108,6 +109,41 @@ salt-formulas:
49        && bash -c 'source /srv/salt/formula-fetch.sh && setupPyEnv && fetchAll' \
50        && eval ${LAYER_CLEANUP}
51
52 +opnfv:
53 +  build: |
54 +    # Some formulas have empty git repos, use the package version
55 +    ARG SALT_FORMULA_VERSION="nightly"
56 +    ENV SALT_FORMULA_VERSION $SALT_FORMULA_VERSION
57 +    ARG SALT_FORMULA_LIST="salt-formula-gnocchi"
58 +    ENV SALT_FORMULA_LIST $SALT_FORMULA_LIST
59 +    ENV APT_REPOSITORY "deb [arch=amd64] http://apt.mirantis.com/xenial ${SALT_FORMULA_VERSION} salt"
60 +    ENV APT_REPOSITORY_GPG "http://apt.mirantis.com/public.gpg"
61 +    RUN echo "Layer extra salt-formulas packages" \
62 +      && echo "$APT_REPOSITORY" | tee /etc/apt/sources.list.d/salt-formulas.list >/dev/null \
63 +      && curl -sL $APT_REPOSITORY_GPG | $SUDO apt-key add - \
64 +      && eval ${LAYER_PKGUPDT} \
65 +      && ${LAYER_INSTALL} ${SALT_FORMULA_LIST} -y --fix-missing -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
66 +      && eval ${LAYER_CLEANUP}
67 +    RUN echo "Layer with OPNFV packages" \
68 +      && eval ${LAYER_PKGUPDT} \
69 +      && ${LAYER_INSTALL} \
70 +           gawk \
71 +           inetutils-ping \
72 +           kmod \
73 +           net-tools \
74 +           openssh-server \
75 +           python-futures \
76 +           python-m2crypto \
77 +           python-msgpack \
78 +           python-netaddr \
79 +           python-oauth \
80 +           python-psutil \
81 +           python-yaml \
82 +      && useradd -m ubuntu \
83 +      && echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu \
84 +      && eval ${LAYER_CLEANUP}
85 +
86 +
87  wheel:
88    requires:
89      - base