第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

無(wú)法通過(guò) Ansible 將 Cloud Formation 部署為 Jinja 模板

無(wú)法通過(guò) Ansible 將 Cloud Formation 部署為 Jinja 模板

慕村225694 2023-03-22 16:59:42
我的角色main.yml如下所示cat ansible/playbooks/roles/patching-cf-ssm/tasks/main.yml---- include_vars: "{{playbook_dir}}/vars/patching-config.yml"  ignore_errors: yes- name: Create a Cloudformation Stack Windows  cloudformation:    stack_name: "something pleasant-static"    state: "present"    region: "{{ AWS_REGION }}"    disable_rollback: true    template_body: "{{ lookup('template', '../../cloudformation/patching/PatchBaseline.yaml.j2') }}"  #when: OStype == "WINDOWS"  with_items: "{{ my_os_baseline }}"最后,Jinja 模板如下:[ansible@ip-172-31-40-59 awsManagedServiceInstance]$ cat cloudformation/patching/PatchBaseline.yaml.j2---Resources:  WindowsBaseline:    Type: AWS::SSM::PatchBaseline    Properties:      Name: My-Managed-{{item.OS}}-Baseline      Description: {{item.OS}} Baseline for {{item.SEVERITY}} with Rating {{item.PatchFilters_Values}}      OperatingSystem: {{ item.OS }}      PatchGroups:        - {{ item.PatchGroup | indent( width=7, indentfirst=True ) }}        # - WinProdLastFri09PM01        # - WinProdLastSat09PM01        # - WinNonProdDayOne09PM01        # - WinNonProdDayTwo09PM01      ApprovalRules:        PatchRules:          - PatchFilterGroup:              PatchFilters:                - Values:                  {{ item.PatchFilters_Values | indent( width=14, indentfirst=True ) }}                  Key: {{ item.SEVERITY }}                - Values:                  {{ item.CLASSIFICATION_Values | indent( width=14, indentfirst=True ) }}                  Key: CLASSIFICATION                - Values:                    - APPLICATION                  Key: PATCH_SET            ApproveAfterDays: 7            ComplianceLevel: CRITICAL不幸的是,我收到如下錯(cuò)誤:fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'template'. Error was a <type 'exceptions.AttributeError'>, original message: 'list' object has no attribute 'splitlines'"}不知道它首先意味著什么以及如何解決它。
查看完整描述

1 回答

?
動(dòng)漫人物

TA貢獻(xiàn)1815條經(jīng)驗(yàn) 獲得超10個(gè)贊

    - {{ item.PatchGroup | indent( width=7, indentfirst=True ) }}

您正在將 a 發(fā)送list到需要換行符分隔字符串的函數(shù)中

您可以輕松重現(xiàn)該爆炸:

- debug:
    msg: '{{ ["alpha", "beta"] | indent( width=7, indentfirst=True ) }}'

然后同樣微不足道的解決方法joinlist

- debug:
    msg: '{{ ["alpha", "beta"] | join("\n") | indent( width=7, indentfirst=True ) }}'



查看完整回答
反對(duì) 回復(fù) 2023-03-22
  • 1 回答
  • 0 關(guān)注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)