Thank you very much ,

I know it right now ,thank you very much

you get the stdout message used register and debug ??

在 2016年7月28日星期四 UTC+8下午2:58:23,Kai Stian Olstad写道:
>
> On 28. juli 2016 07:54, [email protected] <javascript:> wrote: 
> > Thanks for you suggestion but I just get this when use you way 
> > 
> > ``` 
> >    - name: upgrade docker-engine 
> >      apt: 
> >          name: docker-engine 
> >          only_upgrade: docker-engine 
> > #         state: latest 
> > ``` 
> > 
> > ``` 
> > TASK [upgrade docker-engine] 
> > *************************************************** 
> > ok: [xx.xx.xx.xx] 
> > 
> > ``` 
> > 
> > and if I add state:latest, I just think only_upgrade is not work , 
> because 
> > I also can install the latest version without only_upgrade 
>
> I'm not sure I understand you, my test of only_upgrade 
>
> $ dpkg -l htop 
> dpkg-query: no packages found matching htop 
>
> I run this task: 
> - name: upgrade if exist 
>    apt: 
>      name=htop 
>      state=latest 
>      only_upgrade=true 
>
> The output: 
> TASK [upgrade if exist] 
> ******************************************************** 
> changed: [localhost] 
>
> stdout: Reading package lists... 
> Building dependency tree... 
> Reading state information... 
> Skipping htop, it is not installed and only upgrades are requested. 
> 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. 
>
> As you see, nothing was installed and this confirms it 
>
> $ dpkg -l htop 
> dpkg-query: no packages found matching htop 
>
> So the only_upgrade is working in Ansible 2.1.0. 
> The apt module is using the apt-get command and only_upgrade=true adds 
> --only-upgrade as an option to apt-get. 
>
> -- 
> Kai Stian Olstad 
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e5f967a0-501b-4818-8b46-0ae041b913a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to