aarch64: docker: Add missing setuptools dep
[fuel.git] / mcp / patches / docker / 0005-Add-saltminion-maas-build-target.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, 30 Jan 2019 17:21:03 +0100
11 Subject: [PATCH] Add saltminion-maas build target
12
13 ---
14  DockerMake.yml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++
15  invoke.yml     |  5 ++++
16  2 files changed, 69 insertions(+)
17
18 diff --git a/DockerMake.yml b/DockerMake.yml
19 index f30024c..a23541c 100644
20 --- a/DockerMake.yml
21 +++ b/DockerMake.yml
22 @@ -50,6 +50,70 @@ common:
23        && eval ${LAYER_CLEANUP}
24
25
26 +maas:
27 +  requires:
28 +  - python
29 +  build: |
30 +    ENV container docker
31 +    ARG SALT_VERSION="stable"
32 +    ENV SALT_VERSION $SALT_VERSION
33 +    ARG SALT_BOOTSTRAP_OPTS="-PdX ${SALT_VERSION}"
34 +    ENV SALT_BOOTSTRAP_OPTS $SALT_BOOTSTRAP_OPTS
35 +    RUN echo "Layer with MaaS, salt-minion packages" \
36 +      && eval ${LAYER_PKGUPDT} \
37 +      && apt-get upgrade -qy \
38 +      && ${LAYER_INSTALL} maas-common systemd \
39 +      && find /etc/systemd/system \
40 +              /lib/systemd/system \
41 +              -path '*.wants/*' \
42 +              -not -name '*journald*' \
43 +              -not -name '*systemd-tmpfiles*' \
44 +              -not -name '*systemd-user-sessions*' \
45 +              -exec rm \{} \; \
46 +      && systemctl set-default multi-user.target \
47 +      && ${LAYER_INSTALL} \
48 +           at \
49 +           avahi-utils \
50 +           dbconfig-pgsql \
51 +           ipmitool \
52 +           iptables \
53 +           iptables-persistent \
54 +           iputils-ping \
55 +           kmod \
56 +           lsb-release \
57 +           maas-cli \
58 +           maas-dns \
59 +           maas-rack-controller \
60 +           maas-region-api \
61 +           postgresql \
62 +           python-futures \
63 +           python-m2crypto \
64 +           python-msgpack \
65 +           python-netaddr \
66 +           python-oauth \
67 +           python-pip \
68 +           python-psutil \
69 +           python-setuptools \
70 +           python-yaml \
71 +           sysfsutils \
72 +           tcpdump \
73 +      && apt-get download maas-region-controller \
74 +      && dpkg-deb --extract maas-region-controller*.deb maas-region-controller \
75 +      && dpkg-deb --control maas-region-controller*.deb maas-region-controller/DEBIAN \
76 +      && mkdir -p /var/lib/opnfv/etc \
77 +      && mv maas-region-controller/DEBIAN/postinst /var/lib/opnfv/maas-region-controller.postinst \
78 +      && dpkg-deb --build maas-region-controller \
79 +      && dpkg -i maas-region-controller.deb \
80 +      && rm -rf maas* \
81 +      && mv /var/lib/maas /var/lib/postgresql /var/lib/opnfv/ \
82 +      && mv /etc/maas /etc/ssh /var/lib/opnfv/etc/ \
83 +      && mv /var/lib/opnfv/maas-region-controller.postinst /var/lib/dpkg/info/ \
84 +      && python -m pip install -U jinja2==2.11.0 \
85 +      && curl -qL https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | $SUDO sh -s -- -A cfg01 ${SALT_BOOTSTRAP_OPTS} \
86 +      && eval ${LAYER_CLEANUP}
87 +    ENTRYPOINT ["/bin/bash", "-c", "/entrypoint.sh && exec /lib/systemd/systemd"]
88 +
89 +
90  salt:
91    requires:
92    - python
93 diff --git a/invoke.yml b/invoke.yml
94 index 291f4c7..a2f4614 100644
95 --- a/invoke.yml
96 +++ b/invoke.yml
97 @@ -62,6 +62,11 @@ target:
98    #    - salt
99    #  require:
100    #    - saltclass
101 +  saltminion-maas:
102 +    matrix:
103 +      - dist
104 +    require:
105 +      - maas
106
107  dockermake:
108    destination: 'images'