Skip to content
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

Bug Report: --limit no longer working #13111

Closed
j3ffrw opened this issue Nov 10, 2015 · 1 comment
Closed

Bug Report: --limit no longer working #13111

j3ffrw opened this issue Nov 10, 2015 · 1 comment
Assignees
Labels
bug This issue/PR relates to a bug.
Milestone

Comments

@j3ffrw
Copy link

j3ffrw commented Nov 10, 2015

Hi, --limit option is no longer working after commit c753ae6

Ansible Version:

ansible-playbook 2.0.0 (devel d8fb5ef) last updated 2015/11/10 17:07:26 (GMT +800)
lib/ansible/modules/core: (detached HEAD fde6ee1) last updated 2015/11/10 17:11:10 (GMT +800)
lib/ansible/modules/extras: (detached HEAD 6cc43bb) last updated 2015/11/10 17:16:15 (GMT +800)
config file =
configured module search path = Default w/o overrides

Ansible Configuration: Clean version from github

Environment: Linux Mint 17.2 Rafaela, Python 2.7.6

Steps To Reproduce:

Create the inventory file and play.yml

- inventory
host1 ansible_ssh_host=127.0.0.1 ansible_ssh_port=22
host2 ansible_ssh_host=127.0.0.1 ansible_ssh_port=22
host3 ansible_ssh_host=127.0.0.1 ansible_ssh_port=22

[myhostgroup]
host1
host2
host3
  • play.yml

- hosts: all
  connection: local
  tasks:
    - debug: var="{{hostvars[inventory_hostname]}}"
  

Run playbook w/ --list-host option to see affected hosts. It will disregard the -l option and show all hosts.


$ ansible-playbook -i inventory -l "host1" --list-hosts play.yml

playbook: play.yml

  PLAY: #1
    pattern: [u'all']
    hosts (3):
      host3
      host2
      host1

checkout previous commit before c753ae6


$ git checkout e8f83dcba34ce7ea22d63b0e5f0b57b9dd49e853

Re run playbook. Result will only show host specified in -l option.


$ ansible-playbook -i inventory -l "host1" --list-hosts play.yml
 [WARNING]: The variable 'environment' appears to be used already, which is also used internally for environment
variables set on the task/block/play. You should use a different variable name to avoid conflicts with this internal
variable


playbook: play.yml

  PLAY: #1
    pattern: [u'all']
    hosts (1):
      host1
@j3ffrw j3ffrw changed the title --limit no longer working Bug Report: --limit no longer working Nov 10, 2015
@jimi-c jimi-c added this to the v2 milestone Nov 10, 2015
@jimi-c jimi-c closed this as completed in 0b999c6 Nov 10, 2015
@jimi-c jimi-c self-assigned this Nov 10, 2015
@jimi-c
Copy link
Member

jimi-c commented Nov 10, 2015

Closing This Ticket

Hi!

We believe the above commit should resolve this problem for you. This will also be included in the next major release.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.

Thank you!

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants