aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/patches/docker/0005-Add-saltminion-maas-build-target.patch
blob: 2fb4cf523748fd69008d1a8701290a6c4b1bd4c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: Copyright (c) 2019 Mirantis Inc., Enea AB and others.
:
: All rights reserved. This program and the accompanying materials
: are made available under the terms of the Apache License, Version 2.0
: which accompanies this distribution, and is available at
: http://www.apache.org/licenses/LICENSE-2.0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Wed, 30 Jan 2019 17:21:03 +0100
Subject: [PATCH] Add saltminion-maas build target

---
 DockerMake.yml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
 invoke.yml     |  5 +++++
 2 files changed, 66 insertions(+)

diff --git a/DockerMake.yml b/DockerMake.yml
index 9ab7195..2c0b8ac 100644
--- a/DockerMake.yml
+++ b/DockerMake.yml
@@ -50,6 +50,67 @@ common:
       && eval ${LAYER_CLEANUP}


+maas:
+  requires:
+  - python
+  build: |
+    ENV container docker
+    ARG SALT_VERSION="stable"
+    ENV SALT_VERSION $SALT_VERSION
+    ARG SALT_BOOTSTRAP_OPTS="-PdX ${SALT_VERSION}"
+    ENV SALT_BOOTSTRAP_OPTS $SALT_BOOTSTRAP_OPTS
+    RUN echo "Layer with MaaS, salt-minion packages" \
+      && find /etc/systemd/system \
+              /lib/systemd/system \
+              -path '*.wants/*' \
+              -not -name '*journald*' \
+              -not -name '*systemd-tmpfiles*' \
+              -not -name '*systemd-user-sessions*' \
+              -exec rm \{} \; \
+      && systemctl set-default multi-user.target \
+      && eval ${LAYER_PKGUPDT} \
+      && curl -qL https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | $SUDO sh -s -- -A cfg01 ${SALT_BOOTSTRAP_OPTS} \
+      && apt-get upgrade -qy \
+      && ${LAYER_INSTALL} maas-common \
+      && ${LAYER_INSTALL} \
+           at \
+           avahi-utils \
+           dbconfig-pgsql \
+           ipmitool \
+           iptables \
+           iptables-persistent \
+           iputils-ping \
+           kmod \
+           lsb-release \
+           maas-cli \
+           maas-dns \
+           maas-rack-controller \
+           maas-region-api \
+           postgresql \
+           python-futures \
+           python-m2crypto \
+           python-msgpack \
+           python-netaddr \
+           python-oauth \
+           python-psutil \
+           python-yaml \
+           sysfsutils \
+           tcpdump \
+      && apt-get download maas-region-controller \
+      && dpkg-deb --extract maas-region-controller*.deb maas-region-controller \
+      && dpkg-deb --control maas-region-controller*.deb maas-region-controller/DEBIAN \
+      && mkdir -p /var/lib/opnfv/etc \
+      && mv maas-region-controller/DEBIAN/postinst /var/lib/opnfv/maas-region-controller.postinst \
+      && dpkg-deb --build maas-region-controller \
+      && dpkg -i maas-region-controller.deb \
+      && rm -rf maas* \
+      && mv /var/lib/maas /var/lib/postgresql /var/lib/opnfv/ \
+      && mv /etc/maas /etc/ssh /var/lib/opnfv/etc/ \
+      && mv /var/lib/opnfv/maas-region-controller.postinst /var/lib/dpkg/info/ \
+      && eval ${LAYER_CLEANUP}
+    ENTRYPOINT ["/bin/bash", "-c", "/entrypoint.sh && exec /sbin/init"]
+
+
 salt:
   requires:
   - python
diff --git a/invoke.yml b/invoke.yml
index 291f4c7..a2f4614 100644
--- a/invoke.yml
+++ b/invoke.yml
@@ -62,6 +62,11 @@ target:
   #    - salt
   #  require:
   #    - saltclass
+  saltminion-maas:
+    matrix:
+      - dist
+    require:
+      - maas

 dockermake:
   destination: 'images'