aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/patches
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/patches')
-rw-r--r--mcp/patches/0009-maas.py-Add-missing-status-ids.patch38
-rw-r--r--mcp/patches/0011-system.repo-Debian-Add-keyserver-proxy-support.patch118
-rw-r--r--mcp/patches/patches.list2
-rw-r--r--mcp/patches/scripts/0002-salt-master-setup-Group-APT-install-formulas.patch68
4 files changed, 226 insertions, 0 deletions
diff --git a/mcp/patches/0009-maas.py-Add-missing-status-ids.patch b/mcp/patches/0009-maas.py-Add-missing-status-ids.patch
new file mode 100644
index 000000000..648e62e51
--- /dev/null
+++ b/mcp/patches/0009-maas.py-Add-missing-status-ids.patch
@@ -0,0 +1,38 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 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: Sun, 17 Dec 2017 06:30:27 +0100
+Subject: [PATCH] maas.py: Add missing status ids
+
+Status ID list synced from MaaS 2.3 [1].
+
+[1] https://github.com/maas/maas/blob/2.3/src/maasserver/\
+ migrations/builtin/maasserver/0106_testing_status.py#L25
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ _modules/maas.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/_modules/maas.py b/_modules/maas.py
+index e279b70..1df4698 100644
+--- a/_modules/maas.py
++++ b/_modules/maas.py
+@@ -52,7 +52,10 @@ def __virtual__():
+ (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
+ (11, 'Failed deployment'), (12, 'Releasing'),
+ (13, 'Releasing failed'), (14, 'Disk erasing'),
+- (15, 'Failed disk erasing')])
++ (15, 'Failed disk erasing'), (16, 'Rescue mode'),
++ (17, 'Entering rescue mode'), (18, 'Failed to enter rescue mode'),
++ (19, 'Exiting rescue mode'), (20, 'Failed to exit rescue mode'),
++ (21, 'Testing'), (22, 'Failed testing')])
+
+
+ def _format_data(data):
diff --git a/mcp/patches/0011-system.repo-Debian-Add-keyserver-proxy-support.patch b/mcp/patches/0011-system.repo-Debian-Add-keyserver-proxy-support.patch
new file mode 100644
index 000000000..fdf84dcd1
--- /dev/null
+++ b/mcp/patches/0011-system.repo-Debian-Add-keyserver-proxy-support.patch
@@ -0,0 +1,118 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 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: Mon, 22 Jan 2018 00:28:09 +0100
+Subject: [PATCH] system.repo: Debian: Add keyserver proxy support
+
+Introduce a new, optional set of parameters to configure the proxy
+used for key fetching / keyserver access under:
+linux:system:proxy:keyserver:http(s).
+
+Previously, when fetching GPG keys for APT keyring, either using
+public key download & import (as for default repos) or via keyserver,
+we relied on simple `curl` calls or passed it down to Salt aptpkg
+module.
+To be able to retrieve APT keys behind a proxy, one used to have to
+configure the proxy for the Salt minion, which does not yet have
+`no_proxy` support (either *all* or *no* traffic hits the proxy).
+
+When the new http(s) proxy param is set:
+- no longer pass key configuration to Salt aptpkg (until it properly
+ supports `no_proxy`);
+- handle all keys explicitly with `curl` and `apt-key`;
+- set 'http(s)_proxy' env vars for `cmd.run`/`cmd.wait` calls;
+
+If linux:system:proxy:keyserver is not defined, the behavior is
+unchanged for backwards compatibility.
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ README.rst | 16 ++++++++++++++++
+ linux/system/repo.sls | 40 ++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 56 insertions(+)
+
+diff --git a/linux/system/repo.sls b/linux/system/repo.sls
+index 5d4d059..724db5a 100644
+--- a/linux/system/repo.sls
++++ b/linux/system/repo.sls
+@@ -96,13 +96,50 @@ linux_repo_{{ name }}_key:
+ - name: "curl -s {{ repo.key_url }} | apt-key add -"
+ - watch:
+ - file: default_repo_list
++{%- if system.proxy.keyserver is defined %}
++ - env:
++ - http_proxy: {{ system.proxy.get('keyserver', {}).get('http', '') }}
++ - https_proxy: {{ system.proxy.get('keyserver', {}).get('https', '') }}
++{%- endif %}
+
+ {%- endif %}
+
++{#- repo.default is false #}
+ {%- else %}
+
+ {%- if repo.get('enabled', True) %}
+
++{%- if system.proxy.keyserver is defined %}
++
++{%- if repo.get('key') %}
++
++linux_repo_{{ name }}_key:
++ cmd.run:
++ - name: "echo '{{ repo.key }}' | apt-key add -"
++
++{%- elif repo.key_url|default(False) %}
++
++linux_repo_{{ name }}_key:
++ cmd.run:
++ - name: "curl -s {{ repo.key_url }} | apt-key add -"
++ - env:
++ - http_proxy: {{ system.proxy.get('keyserver', {}).get('http', '') }}
++ - https_proxy: {{ system.proxy.get('keyserver', {}).get('https', '') }}
++
++{%- elif repo.key_id is defined and repo.key_server is defined %}
++
++linux_repo_{{ name }}_key:
++ cmd.run:
++ - name: "apt-key adv --keyserver {{ repo.key_server }} --recv {{ repo.key_id }}"
++ - env:
++ - http_proxy: {{ system.proxy.get('keyserver', {}).get('http', '') }}
++ - https_proxy: {{ system.proxy.get('keyserver', {}).get('https', '') }}
++
++{%- endif %}
++
++{#- system.proxy.keyserver #}
++{%- endif %}
++
+ linux_repo_{{ name }}:
+ pkgrepo.managed:
+ {%- if repo.ppa is defined %}
+@@ -115,6 +152,7 @@ linux_repo_{{ name }}:
+ {%- endif %}
+ - file: /etc/apt/sources.list.d/{{ name }}.list
+ - clean_file: {{ repo.clean|default(True) }}
++ {%- if system.proxy.keyserver is not defined %}
+ {%- if repo.key_id is defined %}
+ - keyid: {{ repo.key_id }}
+ {%- endif %}
+@@ -124,6 +162,7 @@ linux_repo_{{ name }}:
+ {%- if repo.key_url is defined %}
+ - key_url: {{ repo.key_url }}
+ {%- endif %}
++ {%- endif %}
+ - consolidate: {{ repo.get('consolidate', False) }}
+ - clean_file: {{ repo.get('clean_file', False) }}
+ - refresh_db: {{ repo.get('refresh_db', True) }}
+@@ -140,6 +179,7 @@ linux_repo_{{ name }}:
+ {%- endif %}
+ {%- endif %}
+
++{#- repo.enabled is false #}
+ {%- else %}
+
+ linux_repo_{{ name }}_absent:
diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list
index 4c5522339..62b0f60d1 100644
--- a/mcp/patches/patches.list
+++ b/mcp/patches/patches.list
@@ -13,6 +13,8 @@
/usr/share/salt-formulas/env: 0006-maas-module-Add-VLAN-DHCP-enable-support.patch
/usr/share/salt-formulas/env: 0007-network.interface-Fix-ifup-OVS-port-with-route.patch
/usr/share/salt-formulas/env: 0008-Handle-file_recv-option.patch
+/usr/share/salt-formulas/env: 0009-maas.py-Add-missing-status-ids.patch
/usr/share/salt-formulas/env: 0010-maas-region-allow-timeout-override.patch
/usr/share/salt-formulas/reclass: 0011-service.horizon.server.cluster-Default-to-v2-API.patch
+/usr/share/salt-formulas/env: 0011-system.repo-Debian-Add-keyserver-proxy-support.patch
/usr/share/salt-formulas/env: 0012-linux.storage.lvm-Disable-filter.patch
diff --git a/mcp/patches/scripts/0002-salt-master-setup-Group-APT-install-formulas.patch b/mcp/patches/scripts/0002-salt-master-setup-Group-APT-install-formulas.patch
new file mode 100644
index 000000000..71632681e
--- /dev/null
+++ b/mcp/patches/scripts/0002-salt-master-setup-Group-APT-install-formulas.patch
@@ -0,0 +1,68 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 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: Tue, 30 Jan 2018 01:23:54 +0100
+Subject: [PATCH] salt-master-setup: Group APT install formulas
+
+Instead of calling `apt install` for each salt formula package that
+we miss, construct a list and install them all at once.
+
+While at it, disable colored output on terminals that don't support
+it, like vt220 (used in OPNFV CI).
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ salt-master-init.sh | 6 ++++++
+ salt-master-setup.sh | 12 +++++++-----
+ 2 files changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/salt-master-init.sh b/salt-master-init.sh
+index 343324c..48a05b9 100755
+--- a/salt-master-init.sh
++++ b/salt-master-init.sh
+@@ -24,6 +24,12 @@ options() {
+ export $(find $path -maxdepth 1 -name '*.env' 2> /dev/null | xargs --no-run-if-empty cat ) > /dev/null
+ done;
+
++ # If terminal does not support color output, stop using it
++ if ! tput setaf 1 && tput sgr0; then
++ SALT_OPTS="${SALT_OPTS/--force-color/--no-color}"
++ return 0
++ fi
++
+ export MAGENTA='\033[0;95m'
+ export YELLOW='\033[1;33m'
+ export BLUE='\033[0;35m'
+diff --git a/salt-master-setup.sh b/salt-master-setup.sh
+index 0dd3036..a0c6311 100755
+--- a/salt-master-setup.sh
++++ b/salt-master-setup.sh
+@@ -347,15 +347,17 @@ install_salt_formula_pkg()
+ # Set essentials if FORMULAS_SALT_MASTER is not defined at all
+ [ -z ${FORMULAS_SALT_MASTER+x} ] && declare -a FORMULAS_SALT_MASTER=("linux" "reclass" "salt" "memcached")
+ for formula_service in "${FORMULAS_SALT_MASTER[@]}"; do
+- echo -e "\nConfiguring salt formula ${formula_service} ...\n"
++ echo -e "Configuring salt formula ${formula_service} ..."
+ [ ! -d "${FORMULAS_PATH}/env/${formula_service}" ] && \
+- if ! $SUDO apt-get install -y salt-formula-${formula_service}; then
+- echo -e "\nInstall salt-formula-${formula_service} failed.\n"
+- exit 1
+- fi
++ _FORMULAS_SALT_MASTER="${_FORMULAS_SALT_MASTER} salt-formula-${formula_service}"
++ # Create links first, install pkgs later
+ [ ! -L "/srv/salt/reclass/classes/service/${formula_service}" ] && \
+ ln -sf ${FORMULAS_PATH}/reclass/service/${formula_service} /srv/salt/reclass/classes/service/${formula_service}
+ done
++ if ! $SUDO apt-get install -qqq -y ${_FORMULAS_SALT_MASTER}; then
++ echo -e "\nInstall ${_FORMULAS_SALT_MASTER} failed.\n"
++ exit 1
++ fi
+ ;;
+ rhel)
+ # TODO