New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: portage - support for update yes/no #18982

Closed
janreges opened this Issue Dec 8, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@janreges

janreges commented Dec 8, 2016

Hi,

i'm from Gentoo community and "portage" has one inconvenience/restriction.

Attribute "update" is not possible to set to "no" value. It have to be "yes", or undefined (so implicit "no")

I need to implement feature, that all our roles and "portage" tasks has been called with update=yes, or update=no (controlled by common variable, for example portage: ... update="{{ portage_update }}"

So, request to update any package will be controlled by my common "portage_update" variable.

On daily basis, package updating is undesirable. But weekly/monthly i need to execute all roles with portage_update: true.

Could you accept also "update=no" in "portage"?

Thank you.

@ansibot ansibot added the affects_2.3 label Dec 13, 2016

@bcoca

This comment has been minimized.

Show comment
Hide comment
@bcoca

bcoca Dec 16, 2016

Member

If i understand your request correctly, you want 'no' to be a valid value for update.

It already is as update is defined as a boolean, so yes/no/true/false are all valid. you can also always use the omit key.

Member

bcoca commented Dec 16, 2016

If i understand your request correctly, you want 'no' to be a valid value for update.

It already is as update is defined as a boolean, so yes/no/true/false are all valid. you can also always use the omit key.

@bcoca bcoca added the needs_info label Dec 16, 2016

@Lujeni

This comment has been minimized.

Show comment
Hide comment
@Lujeni

Lujeni Dec 27, 2016

Contributor

Hello @janreges @bcoca

I use Gentoo with ansible but i cant reproduce your case.
It's seems that the update field can be set with no value (the portage option --update is added when update value is True here).

ansible version: 2.2.0.0

- name: test portage update
  hosts: all
  become: true
  tasks:
   - name: test portage update
     portage:
       name: vim
       update: no
# result with `no` in debug mode (print the arguments)~/works/repos/perso/ansible/issue_18982 
00:06 $ ansible-playbook -i localhost, test.yml -c local -v
No config file found; using defaults

PLAY [test portage update *************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [test portage update] *****************************************************
changed: [localhost] => {"changed": true, "msg": []}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0
# result with `yes`~/works/repos/perso/ansible/issue_18982 
00:06 $ ansible-playbook -i localhost, test.yml -c local -v
No config file found; using defaults

PLAY [test portage update *************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [test portage update] *****************************************************
changed: [localhost] => {"changed": true, "msg": ["--update"]}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0
Contributor

Lujeni commented Dec 27, 2016

Hello @janreges @bcoca

I use Gentoo with ansible but i cant reproduce your case.
It's seems that the update field can be set with no value (the portage option --update is added when update value is True here).

ansible version: 2.2.0.0

- name: test portage update
  hosts: all
  become: true
  tasks:
   - name: test portage update
     portage:
       name: vim
       update: no
# result with `no` in debug mode (print the arguments)~/works/repos/perso/ansible/issue_18982 
00:06 $ ansible-playbook -i localhost, test.yml -c local -v
No config file found; using defaults

PLAY [test portage update *************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [test portage update] *****************************************************
changed: [localhost] => {"changed": true, "msg": []}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0
# result with `yes`~/works/repos/perso/ansible/issue_18982 
00:06 $ ansible-playbook -i localhost, test.yml -c local -v
No config file found; using defaults

PLAY [test portage update *************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [test portage update] *****************************************************
changed: [localhost] => {"changed": true, "msg": ["--update"]}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0

@ansibot ansibot removed the needs_info label Dec 27, 2016

@bcoca

This comment has been minimized.

Show comment
Hide comment
@bcoca

bcoca Jan 5, 2017

Member

closing as this already is the case.

Member

bcoca commented Jan 5, 2017

closing as this already is the case.

@bcoca bcoca closed this Jan 5, 2017

@janreges

This comment has been minimized.

Show comment
Hide comment
@janreges

janreges Jan 17, 2017

Thank you @bcoca.

In latest Ansible version, it is possible to set update="no" :-)

janreges commented Jan 17, 2017

Thank you @bcoca.

In latest Ansible version, it is possible to set update="no" :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment