|
| 1 | +#jinja2: trim_blocks:False |
| 2 | +--- |
| 3 | +start_date: "{{ (start_date | regex_replace('^(.*)T.*$', '\\1') | to_datetime('%Y-%m-%d')).strftime('%d %b %Y') }}" |
| 4 | +end_date: "{{ (end_date | regex_replace('^(.*)T.*$', '\\1') | to_datetime('%Y-%m-%d')).strftime('%d %b %Y') }}" |
| 5 | +archive_date: "{{ (archive_date | regex_replace('^(.*)T.*$', '\\1') | to_datetime('%Y-%m-%d')).strftime('%d %b %Y') }}" |
| 6 | + |
| 7 | +timezone: "{{ timezone | default("UTC") }}" |
| 8 | + |
| 9 | +delete_missing_items: false |
| 10 | + |
| 11 | +ansible_tower: |
| 12 | + url: "{{ ansible_tower_url }}" |
| 13 | + admin_username: "{{ ansible_tower_admin_username | default('admin') }}" |
| 14 | + admin_password: "{{ ansible_tower_admin_password }}" |
| 15 | + projects: |
| 16 | + - name: "{{ customer_engagement }}-project" |
| 17 | + description: "Project for {{ customer_engagement }}" |
| 18 | + organization: "{{ organization }}" |
| 19 | + scm_type: "git" |
| 20 | + scm_url: "{{ url }}" |
| 21 | + scm_branch: "master" |
| 22 | + scm_credential_name: "{{ scm_credential_name }}" |
| 23 | + scm_update_on_launch: true |
| 24 | + job_templates: |
| 25 | + - name: "{{ customer_engagement }}-email-notify-list-of-users" |
| 26 | + description: "Job Template to send email notifications to users" |
| 27 | + inventory: "{{ customer_engagement }}-tower-mail-host" |
| 28 | + project: "infra-ansible" |
| 29 | + playbook: "playbooks/notifications/email-notify-list-of-users.yml" |
| 30 | + ask_variables_on_launch: true |
| 31 | + inventories: |
| 32 | + - name: "{{ customer_engagement }}-tower-mail-host" |
| 33 | + variables: "" |
| 34 | + organization: "{{ organization }}" |
| 35 | + sources: |
| 36 | + - name: "{{ customer_engagement }}-mail-host-credentials" |
| 37 | + description: "Email credentials for infra-ansible/mail-host" |
| 38 | + credential: "{{ scm_credential_name }}" |
| 39 | + source_project: "{{ mail_host_source_project }}" |
| 40 | + source: "scm" |
| 41 | + source_path: "redhat.com/inventory/hosts" |
| 42 | + update_on_launch: true |
| 43 | + source_vars: |- |
| 44 | + --- |
| 45 | + - name: "{{ customer_engagement }}-notification-templates" |
| 46 | + description: "Notification templates for {{ customer_engagement }}" |
| 47 | + credential: "{{ scm_credential_name }}" |
| 48 | + source_project: "{{ customer_engagement }}-project" |
| 49 | + source: "scm" |
| 50 | + source_path: "iac/inventories/notifications/inventory/hosts" |
| 51 | + update_on_launch: true |
| 52 | + source_vars: |- |
| 53 | + --- |
| 54 | + |
| 55 | + schedules: |
| 56 | + - name: "{{ customer_engagement }}-welcome-internal" |
| 57 | + description: "Welcome Internal for internal {{ company_name }} engagement members" |
| 58 | + {% raw -%} |
| 59 | + rrule: "{{ start_date | parse_datetime | replace_datetime(hour=5) | to_rrule(timezone=timezone) }}" |
| 60 | + {%- endraw %} |
| 61 | + unified_job_template: "{{ customer_engagement }}-email-notify-list-of-users" |
| 62 | + enabled: {{ enable_notifications | default(false) }} |
| 63 | + extra_data: |
| 64 | + body: {% raw %}"{{ welcome_internal.body }}"{% endraw %} |
| 65 | + title: {% raw %}"{{ welcome_internal.title }}"{% endraw %} |
| 66 | + list_of_users: {% raw %}"{{ internal.list_of_users | default([]) }}"{% endraw %} |
| 67 | + list_of_mail_cc: {% raw %}"{{ list_of_mail_cc | default([]) }}"{% endraw %} |
| 68 | + - name: "{{ customer_engagement }}-welcome-all" |
| 69 | + description: "Welcome notification for {{ company_name }} and {{ customer_name }}" |
| 70 | + {% raw -%} |
| 71 | + rrule: "{{ start_date | parse_datetime | replace_datetime(hour=5) | to_rrule(timezone=timezone) }}" |
| 72 | + {%- endraw %} |
| 73 | + unified_job_template: "{{ customer_engagement }}-email-notify-list-of-users" |
| 74 | + enabled: {{ enable_notifications | default(false) }} |
| 75 | + extra_data: |
| 76 | + body: {% raw %}"{{ welcome_all.body }}"{% endraw %} |
| 77 | + title: {% raw %}"{{ welcome_all.title }}"{% endraw %} |
| 78 | + list_of_users: {% raw %}"{{ full.list_of_users | default([]) }}"{% endraw %} |
| 79 | + list_of_mail_cc: {% raw %}"{{ list_of_mail_cc | default([]) }}"{% endraw %} |
| 80 | + - name: "{{ customer_engagement }}-shutoff-reminder" |
| 81 | + description: "Shutoff reminder e-mail for the {{ customer_engagement }} engagement" |
| 82 | + {% raw -%} |
| 83 | + rrule: "{{ end_date | parse_datetime | replace_datetime(hour=5) | add_time(days=3) | to_rrule(timezone=timezone) }}" |
| 84 | + {%- endraw %} |
| 85 | + unified_job_template: "{{ customer_engagement }}-email-notify-list-of-users" |
| 86 | + enabled: {{ enable_notifications | default(false) }} |
| 87 | + extra_data: |
| 88 | + body: {% raw %}"{{ shutoff_reminder.body }}"{% endraw %} |
| 89 | + title: {% raw %}"{{ shutoff_reminder.title }}"{% endraw %} |
| 90 | + list_of_users: {% raw %}"{{ internal.list_of_users | default([]) }}"{% endraw %} |
| 91 | + list_of_mail_cc: {% raw %}"{{ list_of_mail_cc | default([]) }}"{% endraw %} |
| 92 | + - name: "{{ customer_engagement }}-shutoff" |
| 93 | + description: "Shutoff e-mail for the {{ customer_engagement }} engagement" |
| 94 | + {% raw -%} |
| 95 | + rrule: "{{ archive_date | parse_datetime | replace_datetime(hour=5) | to_rrule(timezone=timezone) }}" |
| 96 | + {%- endraw %} |
| 97 | + unified_job_template: "{{ customer_engagement }}-email-notify-list-of-users" |
| 98 | + enabled: {{ enable_notifications | default(false) }} |
| 99 | + extra_data: |
| 100 | + body: {% raw %}"{{ shutoff.body }}"{% endraw %} |
| 101 | + title: {% raw %}"{{ shutoff.title }}"{% endraw %} |
| 102 | + list_of_users: {% raw %}"{{ internal.list_of_users | default([]) }}"{% endraw %} |
| 103 | + list_of_mail_cc: {% raw %}"{{ list_of_mail_cc | default([]) }}"{% endraw %} |
0 commit comments