On 12.11.14 22:11, Laurentius Purba wrote:
> Hello all,
> 
> I have question regarding pkgng for FreeBSD.
> 
> The idea is I was trying to update php on one of our development
> servers. The current php version installed is 5.4.28, while we have on
> the port (/usr/ports/lang/php5) is 5.4.34.
> 
> Below is the playbook that I have:
> 
> - hosts: 10.0.21.99
>   remote_user: jdoe
>   sudo: yes
>   tasks:
>     - name: Upgrade php5
>       pkgng: name=lang/php5 state=present cached=yes

Hi Laurentius,

other package manager modules (i. e. 'apt') support a `state=latest`
option for upgrading already installed packages.

According to the docs the pkgng unfortunately doesn't support the
`latest` option for the `state` parameter.

I don't know much about how pkgng works but maybe you can upgrade PHP if
you uninstall the package first and afterwards re-install it. I don't
have a FreeBSD box here, so I can't test it now…

- hosts: 10.0.21.99
   remote_user: jdoe
   sudo: yes
   tasks:
     - name: Uninstall php5
       pkgng: name=lang/php5 state=absent
     - name: Install php5
       pkgng: name=lang/php5 state=present cached=no

Marcus

> 
> From the command line, I executed the following with the output:
> $>  ansible-playbook
> /etc/ansible/config/roles/common/tasks/php-upgrade.yml -K
> sudo password: 
> 
> PLAY [10.0.21.99]
> ************************************************************* 
> 
> GATHERING FACTS
> *************************************************************** 
> ok: [10.0.21.99]
> 
> TASK: [Upgrade php5]
> ********************************************************** 
> ok: [10.0.21.99]
> 
> PLAY RECAP
> ******************************************************************** 
> 10.0.21.99                 : ok=2    changed=0    unreachable=0    failed=0
> 
> My question is, why I cannot upgrade my php version from what is install
> 5.4.28 to 5.434, even though I already use the cached=yes option.
> 
> Thanks for your help, guys.
> 
> -Laurentius
> 
> -- 
> 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]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/9dfbb306-182c-465b-ba1b-4aa355df5c70%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/9dfbb306-182c-465b-ba1b-4aa355df5c70%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
Marcus Jaschen
Bahnhofstr. 10
12555 Berlin
Germany

+4915123038682
[email protected]
GPG Key: https://marcusjaschen.de/_assets/0xCE13FDF2.asc
https://www.marcusjaschen.de/

-- 
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/5468F028.9090600%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to