I think this would be your syntax:
- name: setup directory permissions
file:
path: "{{ item.path }}"
state: "{{ item.state }}"
mode: "{{ item.mode }}"
owner: "{{ item.owner }}"
group: "{{ item.group }}"
with_items:
- { path: "/data/gong", state: "directory", mode: '2775', owner:
"conductor", group: "pipe" }
- { path: "/data/gong/pipe", state: "directory", mode: '0775',
owner: "conductor", group: "pipe" }
- { path: "/data/gong/pipe/conductor", state: "directory", mode:
'0755', owner: "conductor", group: "pipe" }
- { path: "/opt/db", state: "directory", mode: '0775', owner:
"conductor", group: "pipe" }
- { path: "/iraf", state: "directory", mode: '0775', owner: "gong",
group: "pipe" }
- { path: "/local", state: "directory", mode: '0775', owner:
"gong", group: "pipe" }
- { path: "/data/ftps_in", state: "directory", mode: '0775', owner:
"conductor", group: "pipe" }
- { path: "/localpipe", state: "directory", mode: '0775', owner:
"conductor", group: "pipe" }
- { path: "/var/log/local0.log", state: "touch", mode: '0664',
owner: 'root', group: "pipe" }
- { path: "/chroot/files/idl", state: "directory", mode: '0775',
owner: 'root', group: "root" }
On Mon, Mar 8, 2021 at 7:58 AM Vladimir Botka <[email protected]> wrote:
> On Mon, 8 Mar 2021 06:33:03 -0800 (PST)
> "[email protected]" <[email protected]> wrote:
>
> > - name: update file
> > lineinfile:
> > path: {{ item }} *<-- This should describe the files*
> > regexp: "{{ item.from }}"
> > line: "{{ item.replace_with }}"
> > with_items:
> > - { from: parameter1= , replace_with: parameter1=test1 }
> > - { from: parameter1= , replace_with: parameter1=test2 }
> > with_items: *-- > This should be for the path*
> > - “/opt/file1”
> > - “/opt/file2”
>
> Try this
>
> - name: update file
> lineinfile:
> path: "{{ item.0 }}"
> regexp: "{{ item.1.from }}"
> line: "{{ item.1.replace_with }}"
> with_nested:
> - - “/opt/file1”
> - “/opt/file2”
> - - {from: parameter1=, replace_with: parameter1=test1}
> - {from: parameter1=, replace_with: parameter1=test2}
>
> (not tested)
>
> --
> Vladimir Botka
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/20210308155804.17e2826e%40gmail.com
> .
>
--
Chris Bidwell, CISSP
Space Weather Prediction Center
National Oceanic Atmospheric Administration
email: c <[email protected]>[email protected]
office: 303-497-3204
mobile: 720-496-3126
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAHKi8Cjz7_hP%2B6V34S3cTb3hSDXngbmX_TQVONUN5CkH3e0bBw%40mail.gmail.com.