blockinfile:
- blockinfile: path: /path/to/your_file state: present insertafter: EOF content: | your first line your second line your third line
- blockinfile: | dest=/etc/network/interfaces backup=yes content="iface eth0 inet static address 192.168.0.1 netmask 255.255.255.0"
Related
See also
- Ansible modules:
gather_facts, set_fact
,ansible.builtin.file
,lineinfile
,stat
,group
,mount
,git:
,package:
,command:
,shell:
,raw:
,template:
,register:
,user:
, Ansible playbooks examples,tasks:
,lineinfile, blockinfile:
,shell:
,command:
,raw:
,ansible.builtin.file, service:, aws.ecs_taskdefinition, aws.asg, docker_container, kubernetes.core.k8s
,community.
,include_tasks
Advertising: