[ansible-project] Ansible 2.13 yum module - requires minimum version of target python of 2.7 or 3.5. But I already have that

2022-08-05 Thread Daniel Barros
I have an Ansible (2.13) machine targeting a remote centOS 6 with Python 3.6. Remote machine has python3.6 installed and variables are set like this: $ ansible-inventory --host centos-6-vm { "ansible_private_key_file": "~/.ssh/id_rsa", "ansible_python_interpreter":

Re: [ansible-project] Re: Pull of List in a Variable File as Extra-Vars

2022-08-05 Thread wpgpo...@gmail.com
Hello Vladimir, It does works successfully. Many thanks and highly appreciated. This thread is RESOLVED. Thanks... WP On Thursday, August 4, 2022 at 7:35:34 PM UTC-5 vbo...@gmail.com wrote: > > On Wednesday, August 3, 2022 at 5:02:16 PM UTC-4 wpgpo...@gmail.com > wrote: > > >

[ansible-project] 'include_vars' doesn't find the vars file

2022-08-05 Thread dulhaver via Ansible Project
I want to include a defaults, or variable file in the /defaults/main.yml of a role I am playing Upon execution I am getting "the defaults/main.yml file for role 'postgres_disable' must contain a dictionary of variables" == DETAILED ERROR

Re: [ansible-project] Lineinfile - Skip/Update an item inside "with_items" using conditions

2022-08-05 Thread farrukh ahmed
Thanks @utoddl for your time and reply. when: item.line is not search(omit) This solution actually worked for me. Thanks & regards, FARRUKH On Friday, August 5, 2022 at 5:22:03 PM UTC+5 uto...@gmail.com wrote: > That "when:" should be > > when: item.line is not search(omit) > > On

Re: [ansible-project] Lineinfile - Skip/Update an item inside "with_items" using conditions

2022-08-05 Thread Todd Lewis
That "when:" should be when: item.line is not search(omit) On Friday, August 5, 2022 at 8:03:34 AM UTC-4 Todd Lewis wrote: > - name: "Update Redis Parameters in {{ redis_config_path }}" > lineinfile: > path: "{{ redis_config_path }}" > backrefs: yes >

Re: [ansible-project] Lineinfile - Skip/Update an item inside "with_items" using conditions

2022-08-05 Thread Todd Lewis
- name: "Update Redis Parameters in {{ redis_config_path }}" lineinfile: path: "{{ redis_config_path }}" backrefs: yes regexp: "{{ item.regexp }}" line: "{{ item.line }}" when: item.line is match(omit) with_items: - { regexp:

Re: [ansible-project] Lineinfile - Skip/Update an item inside "with_items" using conditions

2022-08-05 Thread Stefan Hornburg (Racke)
On 05/08/2022 13:31, farrukh ahmed wrote: Thanks for your reply Vladimir Botka. This is my actual case:  defaults > main.yml --- # defaults file for redis_configs redis_config_path: /etc/redis/redis.conf # Default Params Values MAX_MEM: 3000 TCP_KEEPALIVE: 0 TCP_BACKLOG: 511 MAX_CLIENTS:

Re: [ansible-project] Lineinfile - Skip/Update an item inside "with_items" using conditions

2022-08-05 Thread farrukh ahmed
Thanks for your reply Vladimir Botka. This is my actual case: defaults > main.yml --- # defaults file for redis_configs redis_config_path: /etc/redis/redis.conf # Default Params Values MAX_MEM: 3000 TCP_KEEPALIVE: 0 TCP_BACKLOG: 511 MAX_CLIENTS: 15000 TIMEOUT: 1500 And this is: Tasks >

Re: [ansible-project] Lineinfile - Skip/Update an item inside "with_items" using conditions

2022-08-05 Thread Vladimir Botka
On Thu, 4 Aug 2022 23:43:59 -0700 (PDT) farrukh ahmed wrote: > with_items: > - { regexp: '^text1', line: "text1 = {{ VAR1 }}", when: VAR1 is defined } > - { regexp: '^text2', line: "text2 = {{ VAR2 }}" } > - { regexp: '^text3', line: "text3 = {{ VAR3 }}" } Set *default* to avoid errors,

[ansible-project] Lineinfile - Skip/Update an item inside "with_items" using conditions

2022-08-05 Thread farrukh ahmed
I have a question. Can an item inside "with_items" or "loop" be skipped? using condition "when some_variable is not defined" ? Here is my play. *- name: "Update text in the file" lineinfile:path: /path-to-the-file/backrefs: yesregexp: "{{ item.regexp }}"line: "{{