Kodumla ilgili bazı sorunlar yaşıyorum ve sözdizimi hatasını bulamıyorum.Sözdizimi sorunları sonrası Ansible Lineinfile ekleme
Bir güvenlik duvarından çıktı almayı ve bir html dosyasına koymaya çalışıyorum ama takılmaya devam ediyorum. Komut kendi ayrı dosyasında birkaç satır metin çıkarır. Not hedefi korumak için değiştirildi.
- hosts: firewall
gather_facts: no
tasks:
- name: Hardware Info
raw: show asset all
register: output
- local_action: lineinfile dest=dest destination regexp="{{item}}" insertafter="test" line={{item}}
with_items: output.stdout_lines
Hata:
local_action: lineinfile dest=dest insertafter="test" line='{{item}}' ^here We could be wrong, but this one looks like it might be an issue with missing quotes. Always quote template expression brackets when they start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items: - "{{ foo }}"