From d42a2fc9b70da0aa11a2b3fb1ca1948bfdb9f6b3 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 12 Jan 2018 21:28:22 +0100 Subject: [PDF] generate_config: eyaml only encrypted PDFs Silence misleading warnings about failed decription for PDFs that do not use this feature. While at it, print yamllint version used by check-jinja.sh. Change-Id: Ica1ff90abaee8c9bb20996899c8f0a7527133618 Signed-off-by: Alexandru Avadanii --- config/utils/check-jinja2.sh | 3 +++ config/utils/generate_config.py | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/utils/check-jinja2.sh b/config/utils/check-jinja2.sh index 2953ff6a..8a966e52 100755 --- a/config/utils/check-jinja2.sh +++ b/config/utils/check-jinja2.sh @@ -17,6 +17,8 @@ INSTALLER_ADAPTERS='./config/installers/*' TMPF='/tmp/out.yml' # should be outside Jenkins WS to prevent data leakage RC=0 +echo "Using $(yamllint --version)" + # Build a table header, using ';' as column sep SUMMARY='PDF Verify Matrix;YAML Lint;' for adapter in ${INSTALLER_ADAPTERS}; do @@ -26,6 +28,7 @@ done # Iterate all PDFs, check with each installer adapter, log results while IFS= read -r lab_config; do valid_yaml='OK' + echo -e "\n###################### ${lab_config} ######################\n" echo -e "\n\nyamllint -s ${lab_config}" if ! yamllint -s "${lab_config}"; then valid_yaml='FAIL'; fi SUMMARY+="\n${lab_config#labs/};${valid_yaml};" diff --git a/config/utils/generate_config.py b/config/utils/generate_config.py index dfc6e6c4..cf558e28 100755 --- a/config/utils/generate_config.py +++ b/config/utils/generate_config.py @@ -52,18 +52,19 @@ ENV = Environment(loader=FileSystemLoader(os.path.dirname(ARGS.jinja2))) ENV.filters['ipaddr_index'] = ipaddr_index ENV.filters['dpkg_arch'] = dpkg_arch -# Run `eyaml decrypt` on the whole file, in case any PDF data is encrypted +# Run `eyaml decrypt` on the whole file, but only if PDF data is encrypted # Note: eyaml return code is 0 even if keys are not available try: - DICT = yaml.safe_load(check_output(['eyaml', 'decrypt', '-f', ARGS.yaml])) + if 'ENC[PKCS7' in open(ARGS.yaml).read(): + DICT = yaml.safe_load(check_output(['eyaml', 'decrypt', + '-f', ARGS.yaml])) except CalledProcessError as ex: - logging.error('eyaml decryption failed!') + logging.error('eyaml decryption failed! Fallback to raw data.') except OSError as ex: - logging.warn('eyaml not found, skipping decryption') + logging.warn('eyaml not found, skipping decryption. Fallback to raw data.') try: DICT['details'] except (NameError, TypeError) as ex: - logging.warn('PDF decryption skipped, fallback to using raw data.') with open(ARGS.yaml) as _: DICT = yaml.safe_load(_) -- cgit 1.2.3-korg From 90e2b5ea413edb1f12d0f6fbcc58e7c68b2aaa57 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 12 Jan 2018 22:27:26 +0100 Subject: [PDF] check-jinja: Disable check against template config/pdf/pod1*yaml files are not valid PDFs, but only templates. Trying to expand said files against installer adapters would lead to funky results, since most fields are expressed as '{val1|val2}' in the template files. Change-Id: Ieec4d596d0b5246aa506239183a31463951403e7 Signed-off-by: Alexandru Avadanii --- config/utils/check-jinja2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/utils/check-jinja2.sh b/config/utils/check-jinja2.sh index 8a966e52..f23d389c 100755 --- a/config/utils/check-jinja2.sh +++ b/config/utils/check-jinja2.sh @@ -52,7 +52,7 @@ while IFS= read -r lab_config; do done < <(find "${adapter}" -name '*.j2') SUMMARY+="${pdf_yaml_pass}/${pdf_inst_pass}/${pdf_inst};" done -done < <(find 'config' 'labs' -name 'pod*.yaml') +done < <(find 'labs' -name 'pod*.yaml') rm -f "${TMPF}" echo -e '\n\nNOTE: tuple fmt: (valid YAML output/sucessful parse/templates).\n' -- cgit 1.2.3-korg From ff8a684abb229ce0160440291abb0e92604c809e Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 12 Jan 2018 19:45:21 +0100 Subject: [PDF] Fix yamllint issues in installer adapters Although current YAML files in Pharos are all valid according to yamllint, the resulting YAMLs after PDF/IDF + IA interpolations still have a lot of violations, which need to be addressed. PDF changes: - bii/pod1: + fix typo in disks_A reference; IDF changes: - replace empty strings with `~` keyword (will be expanded to 'None'); IA (installer adapter) changes: - apex: + add missing document start; - compass4nfv: + too few spaces before comment; + missing starting space in comment; + replace '\t' with spaces; - daisy: + None; - fuel: + check conf.idf is defined first (fix parse for PODs without IDF); + move document start outside conf.idf condition - joid: + None; This is not an exhaustive change, some yamllint issues are still there but require either refactoring IAs or changing the PDF/IDF files in a way that needs the respective maintainer's input. Change-Id: I26743e265217e892b6a94de96a016c295ea24fb5 Signed-off-by: Alexandru Avadanii --- config/installers/apex/pod_config.yaml.j2 | 1 + config/installers/compass4nfv/network.yml.j2 | 4 ++-- config/installers/compass4nfv/network_ocl.yml.j2 | 2 +- config/installers/compass4nfv/network_onos.yml.j2 | 4 ++-- config/installers/compass4nfv/network_openo.yml.j2 | 4 ++-- .../installers/compass4nfv/os-nosdn-nofeature-ha.yml.j2 | 12 ++++++------ config/installers/compass4nfv/os-nosdn-openo-ha.yml.j2 | 12 ++++++------ config/installers/compass4nfv/os-ocl-nofeature-ha.yml.j2 | 14 +++++++------- config/installers/compass4nfv/os-odl_l2-moon-ha.yml.j2 | 12 ++++++------ .../installers/compass4nfv/os-odl_l2-nofeature-ha.yml.j2 | 12 ++++++------ .../installers/compass4nfv/os-odl_l3-nofeature-ha.yml.j2 | 12 ++++++------ .../installers/compass4nfv/os-onos-nofeature-ha.yml.j2 | 12 ++++++------ config/installers/compass4nfv/os-onos-sfc-ha.yml.j2 | 12 ++++++------ config/installers/fuel/pod_config.yml.j2 | 6 +++--- labs/arm/idf-pod5.yaml | 2 +- labs/arm/idf-pod6.yaml | 2 +- labs/bii/pod1.yaml | 4 ++-- labs/ericsson/idf-pod1.yaml | 2 +- labs/lf/idf-pod2.yaml | 16 ++++++++-------- labs/lf/idf-pod5.yaml | 16 ++++++++-------- labs/zte/idf-pod1.yaml | 2 +- 21 files changed, 82 insertions(+), 81 deletions(-) diff --git a/config/installers/apex/pod_config.yaml.j2 b/config/installers/apex/pod_config.yaml.j2 index abb3ddb8..b681215e 100644 --- a/config/installers/apex/pod_config.yaml.j2 +++ b/config/installers/apex/pod_config.yaml.j2 @@ -1,3 +1,4 @@ +--- nodes: node1: mac_address: "{{ conf['nodes'][0]['remote_management']['mac_address'] }}" diff --git a/config/installers/compass4nfv/network.yml.j2 b/config/installers/compass4nfv/network.yml.j2 index 2ede0831..a98cc4a9 100644 --- a/config/installers/compass4nfv/network.yml.j2 +++ b/config/installers/compass4nfv/network.yml.j2 @@ -23,7 +23,7 @@ provider_net_mappings: sys_intf_mappings: - name: mgmt interface: eth3 - vlan_tag: {{ conf['nodes'][0]['interfaces'][2]['vlan'] }} #not a good fit + vlan_tag: {{ conf['nodes'][0]['interfaces'][2]['vlan'] }} # not a good fit type: vlan role: - controller @@ -32,7 +32,7 @@ sys_intf_mappings: - name: storage interface: eth2 vlan_tag: 804 - type: {{ conf['nodes'][0]['interfaces'][1]['vlan'] }} #not a good fit + type: {{ conf['nodes'][0]['interfaces'][1]['vlan'] }} # not a good fit role: - controller - compute diff --git a/config/installers/compass4nfv/network_ocl.yml.j2 b/config/installers/compass4nfv/network_ocl.yml.j2 index 68144b62..4d1342d9 100644 --- a/config/installers/compass4nfv/network_ocl.yml.j2 +++ b/config/installers/compass4nfv/network_ocl.yml.j2 @@ -23,7 +23,7 @@ provider_net_mappings: sys_intf_mappings: - name: mgmt interface: eth3 - vlan_tag: {{ conf['nodes'][0]['interfaces'][2]['vlan'] }} #not a good fit + vlan_tag: {{ conf['nodes'][0]['interfaces'][2]['vlan'] }} # not a good fit type: vlan role: - controller diff --git a/config/installers/compass4nfv/network_onos.yml.j2 b/config/installers/compass4nfv/network_onos.yml.j2 index 017560b9..90174c85 100644 --- a/config/installers/compass4nfv/network_onos.yml.j2 +++ b/config/installers/compass4nfv/network_onos.yml.j2 @@ -23,7 +23,7 @@ provider_net_mappings: sys_intf_mappings: - name: mgmt interface: eth3 - vlan_tag: {{ conf['nodes'][0]['interfaces'][2]['vlan'] }} #not a good fit + vlan_tag: {{ conf['nodes'][0]['interfaces'][2]['vlan'] }} # not a good fit type: vlan role: - controller @@ -31,7 +31,7 @@ sys_intf_mappings: - name: storage interface: eth2 - vlan_tag: {{ conf['nodes'][0]['interfaces'][1]['vlan'] }} #not a good fit + vlan_tag: {{ conf['nodes'][0]['interfaces'][1]['vlan'] }} # not a good fit type: vlan role: - controller diff --git a/config/installers/compass4nfv/network_openo.yml.j2 b/config/installers/compass4nfv/network_openo.yml.j2 index a8dc016a..37b34c7f 100644 --- a/config/installers/compass4nfv/network_openo.yml.j2 +++ b/config/installers/compass4nfv/network_openo.yml.j2 @@ -23,7 +23,7 @@ provider_net_mappings: sys_intf_mappings: - name: mgmt interface: eth3 - vlan_tag: {{ conf['nodes'][0]['interfaces'][2]['vlan'] }} #not a good fit + vlan_tag: {{ conf['nodes'][0]['interfaces'][2]['vlan'] }} # not a good fit type: vlan role: - controller @@ -32,7 +32,7 @@ sys_intf_mappings: - name: storage interface: eth2 vlan_tag: 804 - type: {{ conf['nodes'][0]['interfaces'][1]['vlan'] }} #not a good fit + type: {{ conf['nodes'][0]['interfaces'][1]['vlan'] }} # not a good fit role: - controller - compute diff --git a/config/installers/compass4nfv/os-nosdn-nofeature-ha.yml.j2 b/config/installers/compass4nfv/os-nosdn-nofeature-ha.yml.j2 index 38b7e260..2dcf048c 100644 --- a/config/installers/compass4nfv/os-nosdn-nofeature-ha.yml.j2 +++ b/config/installers/compass4nfv/os-nosdn-nofeature-ha.yml.j2 @@ -10,7 +10,7 @@ --- TYPE: baremetal FLAVOR: cluster -POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' #expects string ipmitool +POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' # expects string ipmitool ipmiUser: {{ conf['jumphost']['remote_params']['user'] }} ipmiPass: {{ conf['jumphost']['remote_params']['pass'] }} @@ -18,7 +18,7 @@ ipmiVer: '{{ conf['jumphost']['remote_params']['versions'][0] }}' hosts: - name: {{ conf['nodes'][0]['name'] }} - mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][0]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][0]['interfaces'][1]['mac_address'] }}' @@ -31,7 +31,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][1]['name'] }} - mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][1]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][1]['interfaces'][1]['mac_address'] }}' @@ -43,7 +43,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][2]['name'] }} - mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][2]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][2]['interfaces'][1]['mac_address'] }}' @@ -55,7 +55,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][3]['name'] }} - mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][3]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][3]['interfaces'][1]['mac_address'] }}' @@ -66,7 +66,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][4]['name'] }} - mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][4]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][4]['interfaces'][1]['mac_address'] }}' diff --git a/config/installers/compass4nfv/os-nosdn-openo-ha.yml.j2 b/config/installers/compass4nfv/os-nosdn-openo-ha.yml.j2 index 88823b7a..6deb19de 100644 --- a/config/installers/compass4nfv/os-nosdn-openo-ha.yml.j2 +++ b/config/installers/compass4nfv/os-nosdn-openo-ha.yml.j2 @@ -10,7 +10,7 @@ --- TYPE: baremetal FLAVOR: cluster -POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' #expects string ipmitool +POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' # expects string ipmitool ipmiUser: {{ conf['jumphost']['remote_params']['user'] }} ipmiPass: {{ conf['jumphost']['remote_params']['pass'] }} @@ -26,7 +26,7 @@ deploy_options: hosts: - name: {{ conf['nodes'][0]['name'] }} - mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][0]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][0]['interfaces'][1]['mac_address'] }}' @@ -39,7 +39,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][1]['name'] }} - mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][1]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][1]['interfaces'][1]['mac_address'] }}' @@ -51,7 +51,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][2]['name'] }} - mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][2]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][2]['interfaces'][1]['mac_address'] }}' @@ -63,7 +63,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][3]['name'] }} - mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][3]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][3]['interfaces'][1]['mac_address'] }}' @@ -74,7 +74,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][4]['name'] }} - mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][4]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][4]['interfaces'][1]['mac_address'] }}' diff --git a/config/installers/compass4nfv/os-ocl-nofeature-ha.yml.j2 b/config/installers/compass4nfv/os-ocl-nofeature-ha.yml.j2 index 57c6ad89..d03c7e87 100644 --- a/config/installers/compass4nfv/os-ocl-nofeature-ha.yml.j2 +++ b/config/installers/compass4nfv/os-ocl-nofeature-ha.yml.j2 @@ -10,7 +10,7 @@ --- TYPE: baremetal FLAVOR: cluster -POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' #expects string ipmitool +POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' # expects string ipmitool ipmiUser: {{ conf['jumphost']['remote_params']['user'] }} ipmiPass: {{ conf['jumphost']['remote_params']['pass'] }} @@ -18,7 +18,7 @@ ipmiVer: '{{ conf['jumphost']['remote_params']['versions'][0] }}' hosts: - name: {{ conf['nodes'][0]['name'] }} - mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][0]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][0]['interfaces'][1]['mac_address'] }}' @@ -32,7 +32,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][1]['name'] }} - mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][1]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][1]['interfaces'][1]['mac_address'] }}' @@ -43,7 +43,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][2]['name'] }} - mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][2]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][2]['interfaces'][1]['mac_address'] }}' @@ -54,7 +54,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][3]['name'] }} - mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][3]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][3]['interfaces'][1]['mac_address'] }}' @@ -65,12 +65,12 @@ hosts: - ceph-osd - name: {{ conf['nodes'][4]['name'] }} - mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][4]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][4]['interfaces'][1]['mac_address'] }}' - eth3: '{{ conf['nodes'][4]['interfaces'][2]['mac_address'] }}' ipmiIp: {{ conf['nodes'][4]['remote_management']['address'] }} - roles: + roles: - compute - ceph-osd diff --git a/config/installers/compass4nfv/os-odl_l2-moon-ha.yml.j2 b/config/installers/compass4nfv/os-odl_l2-moon-ha.yml.j2 index 7b348028..d3d8aa1d 100644 --- a/config/installers/compass4nfv/os-odl_l2-moon-ha.yml.j2 +++ b/config/installers/compass4nfv/os-odl_l2-moon-ha.yml.j2 @@ -9,7 +9,7 @@ --- TYPE: baremetal FLAVOR: cluster -POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' #expects string ipmitool +POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' # expects string ipmitool ipmiUser: {{ conf['jumphost']['remote_params']['user'] }} ipmiPass: {{ conf['jumphost']['remote_params']['pass'] }} @@ -17,7 +17,7 @@ ipmiVer: '{{ conf['jumphost']['remote_params']['versions'][0] }}' hosts: - name: {{ conf['nodes'][0]['name'] }} - mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][0]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][0]['interfaces'][1]['mac_address'] }}' @@ -31,7 +31,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][1]['name'] }} - mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][1]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][1]['interfaces'][1]['mac_address'] }}' @@ -44,7 +44,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][2]['name'] }} - mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][2]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][2]['interfaces'][1]['mac_address'] }}' @@ -57,7 +57,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][3]['name'] }} - mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][3]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][3]['interfaces'][1]['mac_address'] }}' @@ -68,7 +68,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][4]['name'] }} - mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][4]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][4]['interfaces'][1]['mac_address'] }}' diff --git a/config/installers/compass4nfv/os-odl_l2-nofeature-ha.yml.j2 b/config/installers/compass4nfv/os-odl_l2-nofeature-ha.yml.j2 index 9690b1fb..1ba947a5 100644 --- a/config/installers/compass4nfv/os-odl_l2-nofeature-ha.yml.j2 +++ b/config/installers/compass4nfv/os-odl_l2-nofeature-ha.yml.j2 @@ -10,7 +10,7 @@ --- TYPE: baremetal FLAVOR: cluster -POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' #expects string ipmitool +POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' # expects string ipmitool ipmiUser: {{ conf['jumphost']['remote_params']['user'] }} ipmiPass: {{ conf['jumphost']['remote_params']['pass'] }} @@ -18,7 +18,7 @@ ipmiVer: '{{ conf['jumphost']['remote_params']['versions'][0] }}' hosts: - name: {{ conf['nodes'][0]['name'] }} - mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][0]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][0]['interfaces'][1]['mac_address'] }}' @@ -32,7 +32,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][1]['name'] }} - mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][1]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][1]['interfaces'][1]['mac_address'] }}' @@ -45,7 +45,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][2]['name'] }} - mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][2]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][2]['interfaces'][1]['mac_address'] }}' @@ -58,7 +58,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][3]['name'] }} - mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][3]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][3]['interfaces'][1]['mac_address'] }}' @@ -69,7 +69,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][4]['name'] }} - mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][4]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][4]['interfaces'][1]['mac_address'] }}' diff --git a/config/installers/compass4nfv/os-odl_l3-nofeature-ha.yml.j2 b/config/installers/compass4nfv/os-odl_l3-nofeature-ha.yml.j2 index dfb4d29d..d81769c4 100644 --- a/config/installers/compass4nfv/os-odl_l3-nofeature-ha.yml.j2 +++ b/config/installers/compass4nfv/os-odl_l3-nofeature-ha.yml.j2 @@ -9,7 +9,7 @@ --- TYPE: baremetal FLAVOR: cluster -POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' #expects string ipmitool +POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' # expects string ipmitool ipmiUser: {{ conf['jumphost']['remote_params']['user'] }} ipmiPass: {{ conf['jumphost']['remote_params']['pass'] }} @@ -19,7 +19,7 @@ odl_l3_agent: "Enable" hosts: - name: {{ conf['nodes'][0]['name'] }} - mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][0]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][0]['interfaces'][1]['mac_address'] }}' @@ -33,7 +33,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][1]['name'] }} - mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][1]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][1]['interfaces'][1]['mac_address'] }}' @@ -46,7 +46,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][2]['name'] }} - mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][2]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][2]['interfaces'][1]['mac_address'] }}' @@ -59,7 +59,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][3]['name'] }} - mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][3]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][3]['interfaces'][1]['mac_address'] }}' @@ -70,7 +70,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][4]['name'] }} - mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][4]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][4]['interfaces'][1]['mac_address'] }}' diff --git a/config/installers/compass4nfv/os-onos-nofeature-ha.yml.j2 b/config/installers/compass4nfv/os-onos-nofeature-ha.yml.j2 index 042bb2ff..8c731a5b 100644 --- a/config/installers/compass4nfv/os-onos-nofeature-ha.yml.j2 +++ b/config/installers/compass4nfv/os-onos-nofeature-ha.yml.j2 @@ -9,7 +9,7 @@ --- TYPE: baremetal FLAVOR: cluster -POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' #expects string ipmitool +POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' # expects string ipmitool ipmiUser: {{ conf['jumphost']['remote_params']['user'] }} ipmiPass: {{ conf['jumphost']['remote_params']['pass'] }} @@ -17,7 +17,7 @@ ipmiVer: '{{ conf['jumphost']['remote_params']['versions'][0] }}' hosts: - name: {{ conf['nodes'][0]['name'] }} - mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][0]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][0]['interfaces'][1]['mac_address'] }}' @@ -31,7 +31,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][1]['name'] }} - mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][1]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][1]['interfaces'][1]['mac_address'] }}' @@ -44,7 +44,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][2]['name'] }} - mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][2]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][2]['interfaces'][1]['mac_address'] }}' @@ -57,7 +57,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][3]['name'] }} - mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][3]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][3]['interfaces'][1]['mac_address'] }}' @@ -68,7 +68,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][4]['name'] }} - mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][4]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][4]['interfaces'][1]['mac_address'] }}' diff --git a/config/installers/compass4nfv/os-onos-sfc-ha.yml.j2 b/config/installers/compass4nfv/os-onos-sfc-ha.yml.j2 index 746ca361..bbc4723d 100644 --- a/config/installers/compass4nfv/os-onos-sfc-ha.yml.j2 +++ b/config/installers/compass4nfv/os-onos-sfc-ha.yml.j2 @@ -9,7 +9,7 @@ --- TYPE: baremetal FLAVOR: cluster -POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' #expects string ipmitool +POWER_TOOL: '{{ conf['jumphost']['remote_params']['type'] }}tool' # expects string ipmitool ipmiUser: {{ conf['jumphost']['remote_params']['user'] }} ipmiPass: {{ conf['jumphost']['remote_params']['pass'] }} @@ -19,7 +19,7 @@ onos_sfc: "Enable" hosts: - name: {{ conf['nodes'][0]['name'] }} - mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][0]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][0]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][0]['interfaces'][1]['mac_address'] }}' @@ -33,7 +33,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][1]['name'] }} - mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][1]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][1]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][1]['interfaces'][1]['mac_address'] }}' @@ -46,7 +46,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][2]['name'] }} - mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][2]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][2]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][2]['interfaces'][1]['mac_address'] }}' @@ -59,7 +59,7 @@ hosts: - ceph-mon - name: {{ conf['nodes'][3]['name'] }} - mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][3]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][3]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][3]['interfaces'][1]['mac_address'] }}' @@ -70,7 +70,7 @@ hosts: - ceph-osd - name: {{ conf['nodes'][4]['name'] }} - mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' #is this the ipmi mac address? + mac: '{{ conf['nodes'][4]['remote_management']['mac_address'] }}' # this is the ipmi mac address interfaces: - eth1: '{{ conf['nodes'][4]['interfaces'][0]['mac_address'] }}' - eth2: '{{ conf['nodes'][4]['interfaces'][1]['mac_address'] }}' diff --git a/config/installers/fuel/pod_config.yml.j2 b/config/installers/fuel/pod_config.yml.j2 index 06836e9f..bfcec091 100644 --- a/config/installers/fuel/pod_config.yml.j2 +++ b/config/installers/fuel/pod_config.yml.j2 @@ -1,4 +1,5 @@ -{%- if conf.idf.fuel is defined -%} +--- +{%- if conf.idf is defined and conf.idf.fuel is defined -%} {%- if conf.net_config is defined -%} {%- set net_admin = conf.net_config.admin.network -%} {%- set net_mgmt = conf.net_config.mgmt.network -%} @@ -28,8 +29,7 @@ {%- endif -%} {%- if net_public_gw is not defined -%} {%- set net_public_gw = net_public | ipaddr_index('1') -%} - {%- endif -%} ---- + {%- endif %} parameters: _param: diff --git a/labs/arm/idf-pod5.yaml b/labs/arm/idf-pod5.yaml index 52ea6eda..d8a6baf4 100644 --- a/labs/arm/idf-pod5.yaml +++ b/labs/arm/idf-pod5.yaml @@ -15,7 +15,7 @@ idf: bridges: admin: 'admin7_br0' mgmt: 'mgmt7_br0' - private: '' + private: ~ public: 'public7_br0' network: node: diff --git a/labs/arm/idf-pod6.yaml b/labs/arm/idf-pod6.yaml index d21ec92a..2db3865e 100644 --- a/labs/arm/idf-pod6.yaml +++ b/labs/arm/idf-pod6.yaml @@ -15,7 +15,7 @@ idf: bridges: admin: 'admin14_br0' mgmt: 'mgmt14_br0' - private: '' + private: ~ public: 'public14_br0' network: node: diff --git a/labs/bii/pod1.yaml b/labs/bii/pod1.yaml index 29d9a4e2..159401b7 100644 --- a/labs/bii/pod1.yaml +++ b/labs/bii/pod1.yaml @@ -103,8 +103,8 @@ nodes: cpu_cflags: haswell # add values based on CFLAGS in GCC cores: 8 # physical cores, not including hyper-threads memory: 32G - disks: &disk_A # disk list - - name: 'disk1' # first disk + disks: &disks_A # disk list + - name: 'disk1' # first disk disk_capacity: 128G # volume disk_type: ssd # several disk types possible disk_interface: sas # several interface types possible diff --git a/labs/ericsson/idf-pod1.yaml b/labs/ericsson/idf-pod1.yaml index 14f74d41..9b4a98d4 100644 --- a/labs/ericsson/idf-pod1.yaml +++ b/labs/ericsson/idf-pod1.yaml @@ -15,7 +15,7 @@ idf: bridges: admin: 'pxebr' mgmt: 'br-mgmt' - private: '' + private: ~ public: 'br-external' network: node: diff --git a/labs/lf/idf-pod2.yaml b/labs/lf/idf-pod2.yaml index 78c916ef..c3ad1714 100644 --- a/labs/lf/idf-pod2.yaml +++ b/labs/lf/idf-pod2.yaml @@ -48,21 +48,21 @@ idf: fuel: jumphost: bridges: - admin: '' - mgmt: '' - private: '' - public: '' + admin: ~ + mgmt: ~ + private: ~ + public: ~ network: node: # Ordered-list, index should be in sync with node index in PDF - interfaces: &interfaces # Ordered-list, index should be in sync with interface index in PDF - - '' - - '' + - ~ + - ~ busaddr: &busaddr # Bus-info reported by `ethtool -i ethX` - - '' - - '' + - ~ + - ~ - interfaces: *interfaces busaddr: *busaddr - interfaces: *interfaces diff --git a/labs/lf/idf-pod5.yaml b/labs/lf/idf-pod5.yaml index e0e4af28..b7d05cfb 100644 --- a/labs/lf/idf-pod5.yaml +++ b/labs/lf/idf-pod5.yaml @@ -45,21 +45,21 @@ idf: fuel: jumphost: bridges: - admin: '' - mgmt: '' - private: '' - public: '' + admin: ~ + mgmt: ~ + private: ~ + public: ~ network: node: # Ordered-list, index should be in sync with node index in PDF - interfaces: &interfaces # Ordered-list, index should be in sync with interface index in PDF - - '' - - '' + - ~ + - ~ busaddr: &busaddr # Bus-info reported by `ethtool -i ethX` - - '' - - '' + - ~ + - ~ - interfaces: *interfaces busaddr: *busaddr - interfaces: *interfaces diff --git a/labs/zte/idf-pod1.yaml b/labs/zte/idf-pod1.yaml index 42e5dda0..fc09db3f 100644 --- a/labs/zte/idf-pod1.yaml +++ b/labs/zte/idf-pod1.yaml @@ -15,7 +15,7 @@ idf: bridges: admin: 'pxebr' mgmt: 'br-mgmt' - private: '' + private: ~ public: 'br-external' network: node: -- cgit 1.2.3-korg From 497efef7c97a01332b197dd68a278269a4b64b67 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 12 Jan 2018 23:18:00 +0100 Subject: [PDF] check-jinja: Replace encrypted str w/ dummy During PDF validation using `check-jinja.sh`, most if not all encrypted strings will fail to decrypt due to missing keys on the build server. The templater will fallback to using raw plaintext, leading to `line too long` yamllint violations. Since we don't care about the actual value of the unencrypted string, replace the encrypted one with a dummy (shorter) string. Change-Id: I0f96db0e055bf84ad43a1df4a0f2bd86cc50fd22 Signed-off-by: Alexandru Avadanii --- config/utils/check-jinja2.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/utils/check-jinja2.sh b/config/utils/check-jinja2.sh index f23d389c..c33bef50 100755 --- a/config/utils/check-jinja2.sh +++ b/config/utils/check-jinja2.sh @@ -43,7 +43,9 @@ while IFS= read -r lab_config; do echo 'Result: PASS' ((pdf_inst_pass+=1)) echo -e "\nyamllint -s ${jinja_template%.j2}" - if yamllint -s "${TMPF}"; then ((pdf_yaml_pass+=1)); fi + if yamllint -s <(sed 's|ENC\[PKCS.*\]|opnfv|g' "${TMPF}"); then + ((pdf_yaml_pass+=1)); + fi else echo 'Result: FAIL' RC=1 -- cgit 1.2.3-korg