fuel, docs: fuel-menu: Align defaults with OPNFV
[armband.git] / patches / opnfv-fuel / upstream-backports / 0000-fuel-menu-Align-defaults-w-OPNFV-bootstrap-cfg.patch
1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Sun, 9 Apr 2017 14:10:21 +0200
3 Subject: [PATCH] fuel-menu: Align defaults w/ OPNFV bootstrap cfg
4
5 Instead of overwriting fuel_bootstrap_cli.yaml during post-install,
6 with a static config which we need to manually sync in OPNFV after
7 each upstream change, make the whole thing dynamic by syncing (via
8 patch) fuel-menu's default settings with OPNFV bootstrap.
9
10 This allows us to drop the static fuel_bootstrap_cli.yaml.
11
12 JIRA: FUEL-266
13
14 Change-Id: I132f2a272c764ad0fc84b3e0e0e1222b1fab1cd2
15 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
16 ---
17  .../f_bootstrap/post-scripts/03_install_repo.sh    |  5 --
18  build/f_isoroot/f_repobuild/Makefile               |  3 +-
19  build/f_isoroot/f_repobuild/config.mk              |  2 +-
20  .../f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml  | 74 ----------------------
21  build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py |  7 +-
22  ...s-OPNFV-bootstrap-Default-to-local-mirror.patch | 66 +++++++++++++++++++
23  6 files changed, 73 insertions(+), 84 deletions(-)
24  delete mode 100644 build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
25  create mode 100644 build/f_repos/patch/fuel-menu/0001-settings-OPNFV-bootstrap-Default-to-local-mirror.patch
26
27 diff --git a/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh b/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh
28 index be17e7e..431577c 100755
29 --- a/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh
30 +++ b/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh
31 @@ -26,9 +26,4 @@ if [ $? -ne 0 ]; then
32    echo "Error removing /opt/opnfv/nailgun directory!"
33    exit 1
34  fi
35 -mv /opt/opnfv/fuel_bootstrap_cli.yaml /etc/fuel-bootstrap-cli/fuel_bootstrap_cli.yaml
36 -if [ $? -ne 0 ]; then
37 -  echo "Error moving bootstrap image configuration!"
38 -  exit 1
39 -fi
40  echo "Done installing pre-build repo"
41 diff --git a/build/f_isoroot/f_repobuild/Makefile b/build/f_isoroot/f_repobuild/Makefile
42 index 891712b..c61d1ad 100644
43 --- a/build/f_isoroot/f_repobuild/Makefile
44 +++ b/build/f_isoroot/f_repobuild/Makefile
45 @@ -27,6 +27,8 @@ nailgun:
46         rm -Rf nailgun packetary opnfv_config && mkdir opnfv_config
47         # We will analyze fuel-web's fixture files for package lists
48         ln -sf ${F_SUBMOD_DIR}/fuel-web fuel-web
49 +       # Same for fuel-agent's bootstrap package list
50 +       ln -sf ${F_SUBMOD_DIR}/fuel-agent fuel-agent
51         git clone --quiet $(PACKETARY_REPO)
52         if [ -n $(PACKETARY_COMMIT) ]; then \
53                 git -C packetary checkout $(PACKETARY_COMMIT); \
54 @@ -48,7 +50,6 @@ release:nailgun
55         @rm -Rf ../release/opnfv/nailgun
56         @mkdir -p ../release/opnfv
57         @cp -Rp nailgun ../release/opnfv/nailgun
58 -       @cp fuel_bootstrap_cli.yaml ../release/opnfv/
59
60  ############################################################################
61  # Cache operations - only used when building through ci/build.sh
62 diff --git a/build/f_isoroot/f_repobuild/config.mk b/build/f_isoroot/f_repobuild/config.mk
63 index 986ea9e..68101d6 100644
64 --- a/build/f_isoroot/f_repobuild/config.mk
65 +++ b/build/f_isoroot/f_repobuild/config.mk
66 @@ -19,5 +19,5 @@ export MIRROR_UBUNTU_ROOT_arm64=ubuntu-ports
67
68  # Merge all local mirror repo components/section into single "main"
69  # NOTE: When changing this, make sure to also update all consumer config, like:
70 -# - fuel_bootstrap_cli.yaml
71 +# - fuel-menu/fuelmenu/settings.yaml
72  export MIRROR_UBUNTU_MERGE=true
73 diff --git a/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml b/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
74 deleted file mode 100644
75 index 81ca6eb..0000000
76 --- a/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
77 +++ /dev/null
78 @@ -1,74 +0,0 @@
79 -##############################################################################
80 -# Copyright (c) 2015,2016 Ericsson AB and others.
81 -# mskalski@mirantis.com
82 -# All rights reserved. This program and the accompanying materials
83 -# are made available under the terms of the Apache License, Version 2.0
84 -# which accompanies this distribution, and is available at
85 -# http://www.apache.org/licenses/LICENSE-2.0
86 -##############################################################################
87 ----
88 -  root_ssh_authorized_file: /root/.ssh/id_rsa.pub
89 -  extend_kopts: "biosdevname=0 net.ifnames=1"
90 -  ubuntu_release: xenial
91 -  extra_dirs:
92 -    - /usr/share/fuel_bootstrap_cli/files/xenial
93 -  output_dir: /tmp/
94 -  kernel_flavor: linux-image-generic-lts-xenial
95 -  packages:
96 -    - daemonize
97 -    - fuel-agent
98 -    - hwloc
99 -    - i40e-dkms
100 -    - linux-firmware
101 -    - linux-headers-generic
102 -    - live-boot
103 -    - live-boot-initramfs-tools
104 -    - mc
105 -    - mcollective
106 -    - msmtp-mta
107 -    - multipath-tools
108 -    - multipath-tools-boot
109 -    - nailgun-agent
110 -    - nailgun-mcagents
111 -    - network-checker
112 -    - ntp
113 -    - ntpdate
114 -    - openssh-client
115 -    - openssh-server
116 -    - puppet
117 -    - squashfs-tools
118 -    - ubuntu-minimal
119 -    - vim
120 -    - wget
121 -    - xz-utils
122 -    # NOTE(el): Packages required for new generation
123 -    # network checker to be run without an access
124 -    # to repositories.
125 -    - sysfsutils
126 -    - bridge-utils
127 -    - ifenslave
128 -    - irqbalance
129 -    - iputils-arping
130 -  bootstrap_images_dir: /var/www/nailgun/bootstraps
131 -  active_bootstrap_symlink: /var/www/nailgun/bootstraps/active_bootstrap
132 -  flavor: ubuntu
133 -  http_proxy: ""
134 -  https_proxy: ""
135 -  repos:
136 -    - name: ubuntu
137 -      section: "main"
138 -      uri: "http://127.0.0.1:8080/mirrors/ubuntu"
139 -      priority:
140 -      suite: xenial
141 -      type: deb
142 -    - name: mos
143 -      section: "main restricted"
144 -      uri: "http://127.0.0.1:8080/ubuntu/x86_64"
145 -      priority: 1050
146 -      suite: mos10.0
147 -      type: deb
148 -  skip_default_img_build: false
149 -  direct_repo_addresses:
150 -    - "127.0.0.1"
151 -  # User can provide default hashed root password for bootstrap image
152 -  # hashed_root_password: "$6$IInX3Cqo$5xytL1VZbZTusOewFnG6couuF0Ia61yS3rbC6P5YbZP2TYclwHqMq9e3Tg8rvQxhxSlBXP1DZhdUamxdOBXK0."
153 diff --git a/build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py b/build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py
154 index 1a603ee..7c38363 100755
155 --- a/build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py
156 +++ b/build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py
157 @@ -25,7 +25,7 @@
158  #    "main".
159  ##############################################################################
160  # Mirror build steps (for EACH architecture in UBUNTU_ARCH):
161 -# 1. Collect bootstrap package deps from <fuel_bootstrap_cli.yaml>;
162 +# 1. Collect bootstrap package deps from fuel-agent's <settings.yaml.sample>;
163  # 2. Collect all fixture release packages from fuel-web's <openstack.yaml>;
164  # 3. Parse new "opnfv_config.yaml" list of packages (from old fuel-mirror);
165  # 4. Inherit enviroment variable(s) for mirror URLs, paths etc.
166 @@ -156,7 +156,8 @@ MIRROR_UBUNTU_PATH = get_env('MIRROR_UBUNTU_OPNFV_PATH')
167  MIRROR_UBUNTU_TMP_PATH = '{0}.tmp'.format(MIRROR_UBUNTU_PATH)
168  MIRROR_UBUNTU_MERGE = get_env('MIRROR_UBUNTU_MERGE')
169  CFG_MM_UBUNTU = '{0}/ubuntu_mirror_local.yaml'.format(CFG_D)
170 -FUEL_BOOTSTRAP_CLI_FILE = open('fuel_bootstrap_cli.yaml').read()
171 +FUEL_BOOTSTRAP_CLI_FILE = open('fuel-agent/contrib/fuel_bootstrap/'
172 +    'fuel_bootstrap_cli/fuel_bootstrap/settings.yaml.sample').read()
173  FUEL_BOOTSTRAP_CLI = yaml.load(FUEL_BOOTSTRAP_CLI_FILE)
174  FIXTURE_FILE = open('fuel-web/nailgun/nailgun/fixtures/openstack.yaml').read()
175  FIXTURE = yaml.load(FIXTURE_FILE)
176 @@ -215,7 +216,7 @@ for arch in UBUNTU_ARCH.split(' '):
177          write_cfg_file(CFG_MM_UBUNTU, group_main_ubuntu[0])
178
179      # Collect package dependencies from:
180 -    ## 1. fuel_bootstrap_cli.yaml (bootstrap image additional packages)
181 +    ## 1. fuel_bootstrap_cli (bootstrap image additional packages)
182      legacy_unresolved = legacy_diff(None, FUEL_BOOTSTRAP_CLI['packages'] + [
183              FUEL_BOOTSTRAP_CLI['kernel_flavor'],
184              FUEL_BOOTSTRAP_CLI['kernel_flavor'].replace('image', 'headers')],
185 diff --git a/build/f_repos/patch/fuel-menu/0001-settings-OPNFV-bootstrap-Default-to-local-mirror.patch b/build/f_repos/patch/fuel-menu/0001-settings-OPNFV-bootstrap-Default-to-local-mirror.patch
186 new file mode 100644
187 index 0000000..456eea7
188 --- /dev/null
189 +++ b/build/f_repos/patch/fuel-menu/0001-settings-OPNFV-bootstrap-Default-to-local-mirror.patch
190 @@ -0,0 +1,66 @@
191 +From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
192 +Date: Sun, 9 Apr 2017 13:49:28 +0200
193 +Subject: [PATCH] settings: OPNFV bootstrap: Default to local mirror
194 +
195 +JIRA: https://jira.opnfv.org/browse/FUEL-266
196 +
197 +Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
198 +---
199 + fuelmenu/settings.yaml | 36 +++---------------------------------
200 + 1 file changed, 3 insertions(+), 33 deletions(-)
201 +
202 +diff --git a/fuelmenu/settings.yaml b/fuelmenu/settings.yaml
203 +index e93309a..aaf07cd 100644
204 +--- a/fuelmenu/settings.yaml
205 ++++ b/fuelmenu/settings.yaml
206 +@@ -13,47 +13,17 @@ BOOTSTRAP:
207 +   http_proxy: ""
208 +   https_proxy: ""
209 +   repos:
210 +-  - name: "ubuntu"
211 +-    section: "main universe multiverse"
212 +-    uri: "http://archive.ubuntu.com/ubuntu"
213 ++  - name: "ubuntu-local"
214 ++    section: "main"
215 ++    uri: "http://127.0.0.1:8080/mirrors/ubuntu"
216 +     priority: null
217 +     suite: "${codename}"
218 +     type: "deb"
219 +-  - name: "ubuntu-updates"
220 +-    section: "main universe multiverse"
221 +-    uri: "http://archive.ubuntu.com/ubuntu"
222 +-    priority: null
223 +-    suite: "${codename}-updates"
224 +-    type: "deb"
225 +-  - name: "ubuntu-security"
226 +-    section: "main universe multiverse"
227 +-    uri: "http://archive.ubuntu.com/ubuntu"
228 +-    priority: null
229 +-    suite: "${codename}-security"
230 +-    type: "deb"
231 +   - name: "mos"
232 +     section: "main restricted"
233 +     uri: "http://127.0.0.1:8080/ubuntu/x86_64"
234 +     priority: 1050
235 +     suite: "mos${mos_version}"
236 +     type: "deb"
237 +-  - name: "mos-updates"
238 +-    section: "main restricted"
239 +-    uri: "http://mirror.fuel-infra.org/mos-repos/ubuntu/${mos_version}"
240 +-    priority: 1050
241 +-    suite: "mos${mos_version}-updates"
242 +-    type: "deb"
243 +-  - name: "mos-security"
244 +-    section: "main restricted"
245 +-    uri: "http://mirror.fuel-infra.org/mos-repos/ubuntu/${mos_version}"
246 +-    priority: 1050
247 +-    suite: "mos${mos_version}-security"
248 +-    type: "deb"
249 +-  - name: "mos-holdback"
250 +-    section: "main restricted"
251 +-    uri: "http://mirror.fuel-infra.org/mos-repos/ubuntu/${mos_version}"
252 +-    priority: 1100
253 +-    suite: "mos${mos_version}-holdback"
254 +-    type: "deb"
255 + PRODUCTION: docker
256 + FEATURE_GROUPS: []