[ansible-project] Re: APT module to target only OS & not Application repo

2021-02-21 Thread esxi...@gmail.com
I am thinking like below


cat /etc/apt/sources.list |grep -v "#"



deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe

deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted 
universe multiverse




###


except blank output .. 

cat /etc/apt/sources.list |grep -v "#" |grep -v ubuntu






###

anything out of box better way .. i think if this is not in place would be 
a really good feature request for APT/Yum module authors .. 


On Sunday, February 21, 2021 at 1:40:53 PM UTC-8 esxi...@gmail.com wrote:

> Hello
> Is there any way to target only primary OS related packages ?
>
>
> - name: Update all packages to their latest version 
> apt: 
> name: "*" 
> state: latest 
>  
> At times 3rd Party packages are added to /etc/apt/sources.list 
>
> So what is best way to just patch the OS & not the app.. 
>
> Any suggestions to handle this on scale ..
>
> Thanks 
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ff56ea73-6926-46f5-ba86-a63b2f018c71n%40googlegroups.com.


[ansible-project] APT module to target only OS & not Application repo

2021-02-21 Thread esxi...@gmail.com
Hello
Is there any way to target only primary OS related packages ?


- name: Update all packages to their latest version 
apt: 
name: "*" 
state: latest 
 
At times 3rd Party packages are added to /etc/apt/sources.list 

So what is best way to just patch the OS & not the app.. 

Any suggestions to handle this on scale ..

Thanks 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/04f979e5-275a-46ab-9dcd-a7fcad6436c5n%40googlegroups.com.


Re: [ansible-project] when ansible Conditionals

2021-02-21 Thread Kiran Kumar
This playbook check OS & then run diff cmd per OS & works fine

But the Debug output is not compact .. it is verbose mode kind.. if the OS
is not say CentOS it gives 4 to 5 lines stating the same .. the out is not
compact .. somehow is it possible to ignore that .. so mat be debug is not
the way to go .. hence asking to folks for suggestions .. thanks

On Sun, Feb 21, 2021 at 11:12 AM Dick Visser  wrote:

> On Sun, 21 Feb 2021 at 10:06, esxi...@gmail.com 
> wrote:
> >
> > Hello
> >
> > In below how can i skip the output when is not relevant or how to do
> this better way ?
>
>
> It is not clear from your tasks or their name what you are trying to
> achieve.
> "check OS version" - what does that mean?
> More generally speaking, without knowing what you want to do, it's
> also not possible to tell how to do it better.
>
> Also, what does "relevant" mean in this context? That seems a highly
> subjective term...
>
>
>
>
> > Thanks
> >
> > ---
> > -
> >   hosts: temp
> >   become: true
> >   remote_user: ansible
> >   tasks:
> > - name : check OS version for Ubuntu
> >   raw : lsb_release -a
> >   when: ansible_distribution == 'Debian' or ansible_distribution ==
> 'Ubuntu'
> >   register: result
> > - debug:
> > var: result
> >
> >
> > - name : check OS version for CentOS
> >   raw :  cat /etc/redhat-release
> >   when: ansible_distribution == 'CentOS' or ansible_distribution ==
> 'Red Hat enterprise Linux'
> >   register: result
> >
> > - debug:
> > var: result
> >
> >
> > --
> > 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 ansible-project+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c12a8da7-1a2c-4b1b-963e-a9b154601bd4n%40googlegroups.com
> .
>
>
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwP-6C-GyPmn4kN9qvg_DuK8g7Hzqz6A3%2BvXK3WL5Vc28w%40mail.gmail.com
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGhW9Jto2CexOb7twAE60MyVxgj9v3wWVZxBVZz2nsENHhy9cQ%40mail.gmail.com.


Re: [ansible-project] Not able to copy backup files between 2 remote windows server

2021-02-21 Thread jbor...@gmail.com
Your dest should have 2 backslashes at the start, right now it's being 
treated as a local path. Even with a UNC path you are most likely going to 
hit the double hop problem with delegating your credentials. Make sure you  
use Kerberos with credential delegation, CredSSP, or use become on the task 
to bypass that.
On Saturday, February 20, 2021 at 11:57:57 PM UTC+10 prav...@tibco.com 
wrote:

> I am already using remote_src: yes option.
>
> Thanks and Regards,
> Praveen Singh
> On Sat, Feb 20, 2021 at 5:53 AM Ramakrishna Veeragandham <
> ramakri...@gmail.com> wrote:
>
>> Remoe remote_src: yes option and try.  
>>
>> Thanks,
>> Ram
>>
>> On Sat, Feb 20, 2021, 21:44 'Praveen Kumar Singh' via Ansible Project <
>> ansible...@googlegroups.com> wrote:
>>
>>> Hello Everyone,
>>>
>>> I am trying to copy backup files from one remote windows server to 
>>> another windows server using ansible playbook but not able to do so. I am 
>>> using below playbook and which is running successfully also but when I 
>>> check the backup file at destination location it is not present there. So 
>>> any help would be appreciated.
>>>
>>> ---
>>>   - hosts: SQLSERVER
>>>
>>> vars:
>>>  Hostname:
>>>
>>> vars_prompt:
>>>  - name: Hostname
>>>private: no
>>>prompt: Hostname
>>>default:
>>>
>>> tasks:
>>>   - name: Sync SQLSERVER to SQLSERVER2
>>> ansible.windows.win_copy:
>>>src: E:\BACKUP
>>>dest: \{{ Hostname }}\E$\BACKUP\
>>>remote_src: yes
>>>recurse: yes
>>>
>>> Thanks and Regards,
>>> Praveen Singh
>>>
>>> -- 
>>> 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 ansible-proje...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/dbfc0151-effa-43f5-8554-0badd88bcdb0n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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 ansible-proje...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CAPb_6R%3DJbMvA2sTWCbVVy198A3893ec%3DWkNUxpw76hiV9pjZAg%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9e27c478-09bc-45a2-8fd1-836a616841ban%40googlegroups.com.


Re: [ansible-project] when ansible Conditionals

2021-02-21 Thread Dick Visser
On Sun, 21 Feb 2021 at 10:06, esxi...@gmail.com  wrote:
>
> Hello
>
> In below how can i skip the output when is not relevant or how to do this 
> better way ?


It is not clear from your tasks or their name what you are trying to achieve.
"check OS version" - what does that mean?
More generally speaking, without knowing what you want to do, it's
also not possible to tell how to do it better.

Also, what does "relevant" mean in this context? That seems a highly
subjective term...




> Thanks
>
> ---
> -
>   hosts: temp
>   become: true
>   remote_user: ansible
>   tasks:
> - name : check OS version for Ubuntu
>   raw : lsb_release -a
>   when: ansible_distribution == 'Debian' or ansible_distribution == 
> 'Ubuntu'
>   register: result
> - debug:
> var: result
>
>
> - name : check OS version for CentOS
>   raw :  cat /etc/redhat-release
>   when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red 
> Hat enterprise Linux'
>   register: result
>
> - debug:
> var: result
>
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/c12a8da7-1a2c-4b1b-963e-a9b154601bd4n%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwP-6C-GyPmn4kN9qvg_DuK8g7Hzqz6A3%2BvXK3WL5Vc28w%40mail.gmail.com.


Re: [ansible-project] when ansible Conditionals

2021-02-21 Thread Dick Visser
This information is already gathered and available to you by default, no
need for wheel reinventing

On Sun, 21 Feb 2021 at 10:06, esxi...@gmail.com  wrote:

> Hello
>
> In below how can i skip the output when is not relevant or how to do this
> better way ?
>
> Thanks
>
> ---
> -
>   hosts: temp
>   become: true
>   remote_user: ansible
>   tasks:
> - name : check OS version for Ubuntu
>   raw : lsb_release -a
>   when: ansible_distribution == 'Debian' or ansible_distribution ==
> 'Ubuntu'
>   register: result
> - debug:
> var: result
>
>
> - name : check OS version for CentOS
>   raw :  cat /etc/redhat-release
>   when: ansible_distribution == 'CentOS' or ansible_distribution ==
> 'Red Hat enterprise Linux'
>   register: result
>
> - debug:
> var: result
>
>
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c12a8da7-1a2c-4b1b-963e-a9b154601bd4n%40googlegroups.com
> 
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPKgOcgu7CCggoSX53xOuxAoaAq_UGkizOUDddK_Z_BUQ%40mail.gmail.com.


[ansible-project] when ansible Conditionals

2021-02-21 Thread esxi...@gmail.com
Hello

In below how can i skip the output when is not relevant or how to do this 
better way ?

Thanks 

---
-
  hosts: temp
  become: true
  remote_user: ansible
  tasks:
- name : check OS version for Ubuntu
  raw : lsb_release -a
  when: ansible_distribution == 'Debian' or ansible_distribution == 
'Ubuntu'
  register: result
- debug:
var: result


- name : check OS version for CentOS
  raw :  cat /etc/redhat-release
  when: ansible_distribution == 'CentOS' or ansible_distribution == 
'Red Hat enterprise Linux'
  register: result

- debug:
var: result


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c12a8da7-1a2c-4b1b-963e-a9b154601bd4n%40googlegroups.com.