Skip to content

Instantly share code, notes, and snippets.

@metabsd
Created July 15, 2020 18:50
Show Gist options
  • Save metabsd/c145fae2db907f783630d536164eb3b1 to your computer and use it in GitHub Desktop.
Save metabsd/c145fae2db907f783630d536164eb3b1 to your computer and use it in GitHub Desktop.
- name: Network Policy
mymodule:
data:
displayName: "{%- if item.source_project != 'N/A' -%}{{ item.source_project }}{%- endif -%}
{%- if item.source_sectag != 'N/A' -%}.{{ item.source_sectag }}{%- endif -%}"
tags: |
{% if item.source_project != 'N/A' %}
- name: "Project"
strValue: "{{ item.source_project }}"
{% endif %}
{% if item.source_sectag != 'N/A' %}
- name: "sectag"
strValue: "{{ item.source_sectag }}"
{% endif %}
state: present
with_items: "{{ myvariable.list }}"
when: item.source_project != "N/A" or ( item.source_project != "N/A" and item.source_sectag != "N/A" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment