Re: [ansible-project] Apt behaviour

2022-03-28 Thread omodotun Babatope
Hi Brian,

How is it going. thanks for your email.
let me quickly try that out and get back  to you.

Best Regards.
Dotun


On Mon, 28 Mar 2022, 18:08 Brian Coca,  wrote:

> It is not the module, but the data passed into it, for some reason the
> engine is taking it as a string, try adding  |list to the expression:
>
>  name: "{{ fonts_packages|list }}"
>
> --
> --
> Brian Coca
>
> --
> 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/CACVha7dQ-LiYrzcURai-iFDcXus_A9LdunZ2nkWFgh6hT8%2BN8w%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/CAMAO9ZGRmHZhhNhfkY-OCWkcRiPKHQovnZUCD_yeAu29hbq4vg%40mail.gmail.com.


Re: [ansible-project] Apt behaviour

2022-03-28 Thread Brian Coca
It is not the module, but the data passed into it, for some reason the
engine is taking it as a string, try adding  |list to the expression:

 name: "{{ fonts_packages|list }}"

-- 
--
Brian Coca

-- 
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/CACVha7dQ-LiYrzcURai-iFDcXus_A9LdunZ2nkWFgh6hT8%2BN8w%40mail.gmail.com.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread Igor Cicimov
Of course it has everything to do with the module, what else? The 2.4.4 
does the correct thing and takes the list as it is: a list. The module 
documentation also says it needs to be a list.

However, 2.5+ takes that list as a string for some reason and wraps it in a 
list ending in that silly state of a list inside a list. That can't be 
right.



On Monday, March 7, 2022 at 5:08:08 PM UTC+11 Felix Fontein wrote:

> hi,
>
> > Hi all,
> > 
> > Anyone knows why is apt behaving differently here? I have this var
>
> I don't think this is related to the apt module, but to how the
> variable ends up being loaded. It seems to end up as a string, but not
> as a sting in JSON format (which would be converted to a list), but in
> Python format.
>
> Without knowing how exactly you end up with the variable in this format.
>
> (Also please note that both Ansible 2.4.x and 2.5.x are completely
> outdated and End of Line.)
>
> Cheers,
> Felix
>
>
>
> > 
> > fonts_packages:
> > - ttf-wqy-zenhei
> > - fonts-takao-mincho
> > - fonts-indic
> > - ttf-wqy-microhei
> > 
> > and simple task:
> > 
> > - name: install additional fonts
> > apt:
> > name: "{{ fonts_packages }}"
> > state: present
> > 
> > passing the list to apt.
>
>
-- 


* *







Know Your Customer due diligence on demand, powered by 
intelligent process automation




Blogs 
  |  LinkedIn 
  |  Twitter 


 




Encompass Corporation UK Ltd  |  
Company No. SC493055  |  Address: Level 3, 33 Bothwell Street, Glasgow, UK, 
G2 6NL

Encompass Corporation Pty Ltd  |  ACN 140 556 896  |  Address: 
Level 10, 117 Clarence Street, Sydney, New South Wales, 2000

This email 
and any attachments is intended only for the use of the individual or 
entity named above and may contain confidential information. 

If you are 
not the intended recipient, any dissemination, distribution or copying of 
this email is prohibited. 

If received in error, please notify us 
immediately by return email and destroy the original message.








-- 
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/7164ed8c-72f7-4ef1-9237-4e6be65e7092n%40googlegroups.com.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread 'Felix Fontein' via Ansible Project
hi,

> Hi all,
> 
> Anyone knows why is apt behaving differently here? I have this var

I don't think this is related to the apt module, but to how the
variable ends up being loaded. It seems to end up as a string, but not
as a sting in JSON format (which would be converted to a list), but in
Python format.

Without knowing how exactly you end up with the variable in this format.

(Also please note that both Ansible 2.4.x and 2.5.x are completely
outdated and End of Line.)

Cheers,
Felix



> 
> fonts_packages:
>   - ttf-wqy-zenhei
>   - fonts-takao-mincho
>   - fonts-indic
>   - ttf-wqy-microhei
> 
> and simple task:
> 
> - name: install additional fonts
>   apt:
> name: "{{ fonts_packages }}"
> state: present
> 
>  passing the list to apt.

-- 
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/20220307070738.32c92b38%40rovaniemi.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread Rilindo Foster
Given John’s statement, add *update_cache: yes”

- name: install additional fonts
  apt:
name: "{{ fonts_packages }}"
state: present
update_cache: yes

> On Mar 6, 2022, at 8:10 PM, Igor Cicimov  
> wrote:
> 
> Hi all,
> 
> Anyone knows why is apt behaving differently here? I have this var
> 
> fonts_packages:
>   - ttf-wqy-zenhei
>   - fonts-takao-mincho
>   - fonts-indic
>   - ttf-wqy-microhei
> 
> and simple task:
> 
> - name: install additional fonts
>   apt:
> name: "{{ fonts_packages }}"
> state: present
> 
>  passing the list to apt.
> 
> That works in Ansible 2.4.4 as expected:
> 
> "invocation": {
> "module_args": {
>  
> "name": [
> "ttf-wqy-zenhei", 
> "fonts-takao-mincho", 
> "fonts-indic", 
> "ttf-wqy-microhei"
> ], 
> "only_upgrade": false, 
> "package": [
> "ttf-wqy-zenhei", 
> "fonts-takao-mincho", 
> "fonts-indic", 
> "ttf-wqy-microhei"
> ], 
> ...
>  
> But in 2.5+ fails because:
> 
> fatal: [hostname]: FAILED! => {
> "changed": false,
> "invocation": {
> "module_args": {
> 
> "name": "['ttf-wqy-zenhei', 'fonts-takao-mincho', 'fonts-indic', 
> 'ttf-wqy-microhei']",
> "only_upgrade": false,
> "package": [
> "['ttf-wqy-zenhei'",
> " 'fonts-takao-mincho'",
> " 'fonts-indic'",
> " 'ttf-wqy-microhei']"
> ],
> ...
> },
> "msg": "No package(s) matching '['ttf-wqy-zenhei'' available"
> }
> 
> I'm passing a list to apt "name" parameter as per the documentation.
> 
> Thanks
> 
> 
>  
> 
> Know Your Customer due diligence on demand, powered by intelligent process 
> automation
> 
> Blogs   |  LinkedIn 
>   |  Twitter 
> 
>  
> 
> Encompass Corporation UK Ltd  |  Company No. SC493055  |  Address: Level 3, 
> 33 Bothwell Street, Glasgow, UK, G2 6NL
> Encompass Corporation Pty Ltd  |  ACN 140 556 896  |  Address: Level 10, 117 
> Clarence Street, Sydney, New South Wales, 2000
> This email and any attachments is intended only for the use of the individual 
> or entity named above and may contain confidential information. 
> If you are not the intended recipient, any dissemination, distribution or 
> copying of this email is prohibited. 
> If received in error, please notify us immediately by return email and 
> destroy the original message.
> 
> 
> 
> 
> -- 
> 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/13465a54-4216-450c-a9f9-a079495425f3n%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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CC3F3776-ED1C-4136-80F9-AE6B7AD77DDA%40gmail.com.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread John Petro
Usually I tend to see this when the apt cache isn't current.  I am sure
there are other reasons as well, but more than 80% of the time for me, that
usually fixes my issue.

--John

On Sun, Mar 6, 2022 at 9:11 PM Igor Cicimov 
wrote:

> Hi all,
>
> Anyone knows why is apt behaving differently here? I have this var
>
> fonts_packages:
>   - ttf-wqy-zenhei
>   - fonts-takao-mincho
>   - fonts-indic
>   - ttf-wqy-microhei
>
> and simple task:
>
> - name: install additional fonts
>   apt:
> name: "{{ fonts_packages }}"
> state: present
>
>  passing the list to apt.
>
> That works in Ansible 2.4.4 as expected:
>
> "invocation": {
> "module_args": {
>
> "name": [
> "ttf-wqy-zenhei",
> "fonts-takao-mincho",
> "fonts-indic",
> "ttf-wqy-microhei"
> ],
> "only_upgrade": false,
> "package": [
> "ttf-wqy-zenhei",
> "fonts-takao-mincho",
> "fonts-indic",
> "ttf-wqy-microhei"
> ],
> ...
>
> But in 2.5+ fails because:
>
> fatal: [hostname]: FAILED! => {
> "changed": false,
> "invocation": {
> "module_args": {
>
> "name": "['ttf-wqy-zenhei', 'fonts-takao-mincho',
> 'fonts-indic', 'ttf-wqy-microhei']",
> "only_upgrade": false,
> "package": [
> "['ttf-wqy-zenhei'",
> " 'fonts-takao-mincho'",
> " 'fonts-indic'",
> " 'ttf-wqy-microhei']"
> ],
> ...
> },
> "msg": "No package(s) matching '['ttf-wqy-zenhei'' available"
> }
>
> I'm passing a list to apt "name" parameter as per the documentation.
>
> Thanks
>
>
>
>
> Know Your Customer due diligence on demand, powered by intelligent process
> automation
>
>
> Blogs   | LinkedIn
>   | Twitter
> 
>
>
>
>
> Encompass Corporation UK Ltd  | Company No. SC493055 | Address: Level 3,
> 33 Bothwell Street, Glasgow, UK, G2 6NL
>
> Encompass Corporation Pty Ltd  | ACN 140 556 896 | Address: Level 10, 117
> Clarence Street, Sydney, New South Wales, 2000
>
> This email and any attachments is intended only for the use of the
> individual or entity named above and may contain confidential information.
>
> If you are not the intended recipient, any dissemination, distribution or
> copying of this email is prohibited.
>
> If received in error, please notify us immediately by return email and
> destroy the original message.
>
>
>
>
> --
> 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/13465a54-4216-450c-a9f9-a079495425f3n%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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPAjob-psyniU9Fs3sFQNvxrVcYCQ0ks4gCaH7MZMJRErm3wZg%40mail.gmail.com.


[ansible-project] Apt behaviour

2022-03-06 Thread Igor Cicimov
Hi all,

Anyone knows why is apt behaving differently here? I have this var

fonts_packages:
  - ttf-wqy-zenhei
  - fonts-takao-mincho
  - fonts-indic
  - ttf-wqy-microhei

and simple task:

- name: install additional fonts
  apt:
name: "{{ fonts_packages }}"
state: present

 passing the list to apt.

That works in Ansible 2.4.4 as expected:

"invocation": {
"module_args": {
 
"name": [
"ttf-wqy-zenhei", 
"fonts-takao-mincho", 
"fonts-indic", 
"ttf-wqy-microhei"
], 
"only_upgrade": false, 
"package": [
"ttf-wqy-zenhei", 
"fonts-takao-mincho", 
"fonts-indic", 
"ttf-wqy-microhei"
], 
...
 
But in 2.5+ fails because:

fatal: [hostname]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {

"name": "['ttf-wqy-zenhei', 'fonts-takao-mincho', 
'fonts-indic', 'ttf-wqy-microhei']",
"only_upgrade": false,
"package": [
"['ttf-wqy-zenhei'",
" 'fonts-takao-mincho'",
" 'fonts-indic'",
" 'ttf-wqy-microhei']"
],
...
},
"msg": "No package(s) matching '['ttf-wqy-zenhei'' available"
}

I'm passing a list to apt "name" parameter as per the documentation.

Thanks


-- 


* *







Know Your Customer due diligence on demand, powered by 
intelligent process automation




Blogs 
  |  LinkedIn 
  |  Twitter 


 




Encompass Corporation UK Ltd  |  
Company No. SC493055  |  Address: Level 3, 33 Bothwell Street, Glasgow, UK, 
G2 6NL

Encompass Corporation Pty Ltd  |  ACN 140 556 896  |  Address: 
Level 10, 117 Clarence Street, Sydney, New South Wales, 2000

This email 
and any attachments is intended only for the use of the individual or 
entity named above and may contain confidential information. 

If you are 
not the intended recipient, any dissemination, distribution or copying of 
this email is prohibited. 

If received in error, please notify us 
immediately by return email and destroy the original message.








-- 
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/13465a54-4216-450c-a9f9-a079495425f3n%40googlegroups.com.