diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-09-22 21:54:01 +0200 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-12-14 20:16:40 +0100 |
commit | 512968e7b23a077b7396e494624c94468afe9e38 (patch) | |
tree | 8e6c4bd1995eaf859aa79661a4652636012fd3f1 /mcp/patches/salt-formula-maas/0003-Add-machines.delete-co-pxe_nat-sls.patch | |
parent | 4ad7cf5046bbfb90d11f6c172475d75fad257149 (diff) |
[maas] Adopt maas, maasng proposed functions
JIRA: FUEL-364
Change-Id: Ia470fc8103713e7a06cd9647675b0edfb4342bf8
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp/patches/salt-formula-maas/0003-Add-machines.delete-co-pxe_nat-sls.patch')
-rw-r--r-- | mcp/patches/salt-formula-maas/0003-Add-machines.delete-co-pxe_nat-sls.patch | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/mcp/patches/salt-formula-maas/0003-Add-machines.delete-co-pxe_nat-sls.patch b/mcp/patches/salt-formula-maas/0003-Add-machines.delete-co-pxe_nat-sls.patch deleted file mode 100644 index 9f13c4616..000000000 --- a/mcp/patches/salt-formula-maas/0003-Add-machines.delete-co-pxe_nat-sls.patch +++ /dev/null @@ -1,137 +0,0 @@ -From: Alexandru Avadanii <Alexandru.Avadanii@enea.com> -Date: Sun, 19 Aug 2018 05:38:27 +0200 -Subject: [PATCH] Add machines.delete & co, pxe_nat sls - -Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> ---- - maas/machines/delete.sls | 20 ++++++++++++ - maas/machines/mark_broken_fixed.sls | 20 ++++++++++++ - maas/machines/override_failed_testing.sls | 20 ++++++++++++ - maas/pxe_nat.sls | 37 +++++++++++++++++++++++ - 4 files changed, 97 insertions(+) - create mode 100644 maas/machines/delete.sls - create mode 100644 maas/machines/mark_broken_fixed.sls - create mode 100644 maas/machines/override_failed_testing.sls - create mode 100644 maas/pxe_nat.sls - -diff --git a/maas/machines/delete.sls b/maas/machines/delete.sls -new file mode 100644 -index 0000000..2903f92 ---- /dev/null -+++ b/maas/machines/delete.sls -@@ -0,0 +1,20 @@ -+############################################################################## -+# 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 "maas/map.jinja" import region with context %} -+ -+maas_login_admin: -+ cmd.run: -+ - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials" -+ - unless: 'test -e /var/lib/maas/.maas_credentials' -+ -+# TODO: implement delete_machine via _modules/maas.py -+delete_machine: -+ cmd.run: -+ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv machine delete {{ pillar['system_id'] }}" -+ - require: -+ - cmd: maas_login_admin -diff --git a/maas/machines/mark_broken_fixed.sls b/maas/machines/mark_broken_fixed.sls -new file mode 100644 -index 0000000..46691bb ---- /dev/null -+++ b/maas/machines/mark_broken_fixed.sls -@@ -0,0 +1,20 @@ -+############################################################################## -+# 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 "maas/map.jinja" import region with context %} -+ -+maas_login_admin: -+ cmd.run: -+ - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials" -+ - unless: 'test -e /var/lib/maas/.maas_credentials' -+ -+# TODO: implement mark_broken_fixed_machine via _modules/maas.py -+mark_broken_fixed_machine: -+ cmd.run: -+ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv machine mark-broken {{ pillar['system_id'] }} && sleep 10 && maas opnfv machine mark-fixed {{ pillar['system_id'] }} && maas opnfv machine test {{ pillar['system_id'] }} testing_scripts=fio" -+ - require: -+ - cmd: maas_login_admin -diff --git a/maas/machines/override_failed_testing.sls b/maas/machines/override_failed_testing.sls -new file mode 100644 -index 0000000..e7fe1d2 ---- /dev/null -+++ b/maas/machines/override_failed_testing.sls -@@ -0,0 +1,20 @@ -+############################################################################## -+# Copyright (c) 2018 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 "maas/map.jinja" import region with context %} -+ -+maas_login_admin: -+ cmd.run: -+ - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials" -+ - unless: 'test -e /var/lib/maas/.maas_credentials' -+ -+# TODO: implement override_failed_testing via _modules/maas.py -+mark_broken_fixed_machine: -+ cmd.run: -+ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv machine override-failed-testing {{ pillar['system_id'] }}" -+ - require: -+ - cmd: maas_login_admin -diff --git a/maas/pxe_nat.sls b/maas/pxe_nat.sls -new file mode 100644 -index 0000000..8a03c4f ---- /dev/null -+++ b/maas/pxe_nat.sls -@@ -0,0 +1,37 @@ -+############################################################################## -+# 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 -+############################################################################## -+net.ipv4.ip_forward: -+ sysctl.present: -+ - value: 1 -+ -+iptables_pxe_nat: -+ iptables.append: -+ - table: nat -+ - chain: POSTROUTING -+ - jump: MASQUERADE -+ - destination: 0/0 -+ - source: {{ salt['pillar.get']('_param:single_address') }}/{{ salt['pillar.get']('_param:opnfv_net_admin_mask') }} -+ - save: True -+ -+iptables_pxe_source: -+ iptables.append: -+ - table: filter -+ - chain: INPUT -+ - jump: ACCEPT -+ - destination: 0/0 -+ - source: {{ salt['pillar.get']('_param:single_address') }}/{{ salt['pillar.get']('_param:opnfv_net_admin_mask') }} -+ - save: True -+ -+iptables_pxe_destination: -+ iptables.append: -+ - table: filter -+ - chain: INPUT -+ - jump: ACCEPT -+ - destination: {{ salt['pillar.get']('_param:single_address') }}/{{ salt['pillar.get']('_param:opnfv_net_admin_mask') }} -+ - source: 0/0 -+ - save: True |