Dan0maNhi all. i've tried a few different ways to specify this variable, but i can't seem to get it correct. can someone tell me what i'm doing wrong when attempting to reference the variable in the debug task? https://gist.github.com/anonymous/0c83261f011604503f451c29a4017e23
agaffneyDan0maN: you need quotes around each string inside the square brackets, because they are not vars
Dan0maNthanks, agaffney. i tried it with and without the brackets. i honestly don't know if i need the brackets or not. if i just do 'hostvars[inventory_hostname].node', it seems to work
Dan0maNbut anything else and it throws a fit
Dan0maNi've tried with quotes, and it seems to throw escape chars into the variable names
Dan0maNagaffney: thanks for pointing me in the right direction. i think that i might have tried that earlier with double-quotes. working with singles is working as expected
abondGood evening.. Anyone around that can explain how sudo works on the remote machine? Example would be I run a play with become: true and become_method: sudo and a task of yum. What sudo command is actually execute on the remote host?
flowerysongsudo -H -S -n -
flowerysongu root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-brxqgfyoiovvqyagzfmjyucpw
flowerysongvtogaml; /usr/bin/python'"'"'"'"'"'"'"'"' && sleep 0
jborean93abond: if you are ever in doubt running with `-vvv` will tell you the commands that are being run
agaffneyabond: you can also just look at the sudo logs on the remote host
abondjborean93 yes I've done -vvv and reviewed the commands. So my assumption of "sudo yum" isn't being executed. The sudo command is actually "sudo /home/user/.ansible/tmp/ansible-tmp-1518056654.25-228594175601406/yum.py"
agaffneyabond: yes, ansible uses sudo to execute python code, not run individual commands such as yum
agaffneyyou need full sudo permissions (or the next thing to it) for ansible
abondagaffney that would mean a sudo permission of /usr/bin/yum won't allow me to execute it.
abondThat would mean my understand of Ansible and sudo was correct.
abondflowerysong thank you! That's exactly what I was looking for!
mmercerarent -e 'blahblahblah' supposed to take the highest priority, including over group_vars ?
mmercerWas my own fault, had omitted _file
mmercerTook a minute to realize
mmercerOn the bright side, my bug is fixed now
meeshuinotify imo
justai-netImo: shoutout,
meeshunotify justai-net
Imojustai-net, g'day
meeshu.notify imo
meeshu.notify Imo
Guest22214Good morning
Guest22214Im struggling with a password change in my playbook to an ESXi host, it works for Linux boxes using the user module but for ESXi hosts it is failing with the following:
justai-netGuest22214: what's your playbook look like? ESXi modules usually run locally,
Guest22214justai-net: https://pastebin.com/7ueUsXhb
Guest22214Im guessing that vmware is a totally dif structure in playbook?
Guest22214if the group of servers in my hosts file is called test, would this be what I am looking for?
justai-netGuest22214: try, gather_facts: false sudo: no remote_user: root, and attempt to use the shell module.
Guest22214cool ty
Guest22214Im not coming right with my setting root pass on a vmware host, here is the error and playbook, any ideas?
Guest48693o/ if I have a hosts with [this.web] [that.web] [this.db] [that.db] - how can I specify hosts like *db so that I only get db host groups?
jhawkesworth_Guest48693: assuming those are your host groups, you can combine like this... hosts: this.db:that.db
darkl0rdHey guys; quick one. I have a some keys in a dict that I'm trying to filter on as such: nginx.vhosts|map(attribute='ssl')|reject('undefined')|select|list which works as expected -- however, it doesn't when ssl (the key itself) is defined but has no value. Anyone has an idea?
jhawkesworth_I would avoid using . in your group names, as the . operator is so overloaded already
jhawkesworth_darkl0rd could you pass it through a rejectattr(attribute='ssl', 'defined', false) ?
darkl0rdSo it's possible that ssl: is defined (the key) but has no value (which mean my template will assume defaults). However the aforementioned filter, will also filter out "ssl:"
jhawkesworth_guessing a bit, haven't actually checked if defined is an allowable test
darkl0rdreject('undefined') does the same, doesn't it?
jhawkesworth_not tried tbh
darkl0rdit does
darkl0rdwell, it would in theory if 'defined' in your example would be a valid filter.
darkl0rdThis is the reason I ended up using the syntax above in the first place
darkl0rdEffectively I'm searching for a way to filter on keys that may or may not have a value set -- as long as the key itself is defined.
jhawkesworth_hmm, wondering if there's a way to make the dict more regular...
darkl0rdwell you knwo, I can add a subkey ssl.enabled: True
darkl0rdBut you know, at this point - I'm just curious as to how I can do the above :D
jhawkesworth_defined is a valid jinja2 test http://jinja.pocoo.org/docs/2.10/templates/#builtin-tests
darkl0rdit doesn't matter rejectattr(.., defined, false) or reject('undefined') is identical.
jhawkesworth_fair enough
jhawkesworth_the tests all seem to take a value
jhawkesworth_sorry out of ideas :-(
darkl0rdthe reject filter I'm using works.
darkl0rdExcept it rejects too much
darkl0rdit also rejects "ssl: null"
darkl0rdI only want it to reject entries where "ssl" is not defined as a key
darkl0rdSurely there must be a jinja guru in here? ;-)
darkl0rdI can do it like this: with_items: "{{ nginx.vhosts }}" .. when: item['ssl'] is defined
winem_I guess it sounds like a weird random question again.. but is there a way to change the key-file when running playbooks? background: the common role deploys a special ssh config for some customers. this ssh config requires signed ssh keys. so, as soon as the config is deployed and the host was rebooted or ansible initializes a new connection, you have to use another (the signed) private key. right now I use a workaround in the playbook
winem_structure, but just wondering if there is any chance to do it
kfjWinem - that's just what I was after finding out
Floflobelhello, I try to configure the authorized_keys for several users and delete the old keys (thanks to the "exclusive" function). I try with a loop and it does not work, my first test is with a website and the second with key insertion in the variable. Paste: https://paste.fedoraproject.org/paste/dGWxvuEclcxzvqA4gRjmvQ
Kim^JFloflobel: For the first, you need "{{ lookup('file', item.value.keys) }}"
Kim^JFloflobel: For the second, you need to indent the values with 6 spaces.
Kim^JFloflobel: https://paste.fedoraproject.org/paste/AzvFaRST5Z~Rhdd0dJHdFg
FloflobelWo ! Thank's for quick answer, I will try
petn-randallkfj: You probably want meta: reset_connection then. http://docs.ansible.com/ansible/latest/meta_module.html
kfjthanks petn-randall - looks like what I'm after
winem_kfj: so you also use a changed structure in your playbooks?
kfjwinem_: Spin up a VM instance, add "normal" user keys as root, then continue as the "normal user". That way we get to see who has done what
winem_ah, got it. but the security restrictions of the customer do not permit any user to login without a signed key from his CA.
winem_so maybe it makes sense to have a dedicated playbook here that does nothing else except for deploying the ssh config and keep the existing stuff as it is while using the signed key.
winem_to be exact: the public keys in ~/.ssh/ are ignored as soon as we applied the new ssh config
winem_*sshd config
adamsysadminHas anyone seen this error? failed to combine variables, expected dicts but got a 'dict' and a 'AnsibleSequence'
adamsysadminI have several variable files, all the same (but with different values in the dictionary) and used by the same roles
adamsysadminbut only some of them cause this error
meowtismadamsysadmin: which version?
meowtismadamsysadmin: apt/rpm/pip ?
petn-randallwinem_: You can use meta: reset_connection to reset the connection. Check the docs about it for details.
adamsysadminand pip
winem_petn-randall: that sounds like it could help. many thanks.
adamsysadminCurrently I'm running this on manjaro for dev
adamsysadminDoes anyone hear prefer using the repo packages rather than pip? Because I believe the offical docs recommend pip
rvgateadamsysadmin, i use the ansible/ansible ppa
andoladamsysadmin: I prefer repo packages, not having to deal with additional dependecies. While pip might satisfy python dependencies for you it will not handle additional system dependecies certain Python libraries might have.
bordelhey guys, I'm wondering, does anybody know what are these vault_ids with ansible-vault? I don't find documentation about it...
andoladamsysadmin: Also, what official docs recommend pip? http://docs.ansible.com/ansible/latest/intro_installation.html seem to generally recommend OS packages, with pip as a second recommendation if that isn't an option.
adamsysadminI think I was mistaken there..
AndreasLutroif you can force everyone to work on the same operating system and version, or run ansible from a central (set of) machines, then operating system packages are fine. if not, pip will let you be sure that everyone is running the same version of ansible
bordelFrom my experience having a control machine is a better pattern
adamsysadminYup I'm running a control machine in prod
bordelbut nothing on this subject in the ansible docs
adamsysadminSo thanks for the tip!
daincredibleholgGood morning.
unshurHello, a quick question for you... Why « "ansible-playbook -i hosts test.yml -e "retry_files_save_path = ./tmp2/" » is generating the retry in the same path, instead of creating it in tmp2 ?
unshurIf I configure the save path in an ansible.cfg file it works fine.
bordelunshur: retry_files_save_path is probably to be stored in your ansible.cfg file
unshurbordel: so it does not work as an extra var? I would like to use a dynamic path depending on the execution
bordelthere's a difference between ansible's variables that are used to configure ansible binary execution behaviour and ansible's playbooks variables (that you can pass with -e)
unshurbordel: ok that means no, thanks for the explanation
bordel(I'm no ansible expert, but I thing that it's how it works
benzhi channel
benzcan i replace this form of output
benz"component : [u'group1', u'grou2']"
benzby expanding the list and get 2 lines
daincredibleholgI try to debug a playbook and use `strategy:debug` and the debugger starts, but using the documented commands from here: http://docs.ansible.com/ansible/latest/playbooks_debugger.html does nothing. Meaning: I see the `(debug)` but typing `p task` or `p vars` or `redo` does nothing, hitting enter just goes to the next line which is empty
daincredibleholgSadly, I am stuck at Ansible for this.
daincredibleholgAny ideas?
liberforce[m]Hi there
liberforce[m]May someone please reopen following bug?
liberforce[m]can't find a way to reopen it in the user interface
JustASlackeris there a way to check for the type of a variable? is that even needed?
JustASlackerif var is defined and type(var)==list ?
JustASlackerI guess I could use sequence or iterable
colo-workwith an ini-style inventory file, can I define a host or group variable that's a proper list of values?
cwegenerliberforce[m]: re-opening issues requires admin permission on the github repository. maybe jhawkesworth_ can help
JustASlackerIm too stupid for jinja filters
JustASlacker"AnsibleUndefinedVariable: 'iterable'
JustASlackervar is iterable
JustASlackerACTION shakes fist
cwegenerJustASlacker: there's a built-in test in jinja2 called 'sequence(variable)' that returns true if variable is a sequence.
cwegenerJustASlacker: Then, the next one is 'number(variable)' that returns true if the variable is a number
cwegenerJustASlacker: and same goes for 'string(variable)'
JustASlackeryes, now I got it
cwegenerJustASlacker: Lastly, 'mapping(variable)' returns true if the variable is a mapping/dict
JustASlackervar is sequence and var is not string
JustASlackerI tried "if var|sequence" and "if sequence(var)"
JustASlackerbut thanks for responding ^_^
cwegener"|" is only used for filters. not for tests.
JustASlackerah, good to know
cukalHi, I'm using Ansible 2.4.3 and win_path module to add a Path entry. This works as the Path variable is entered in the Advanced Settings and I can see it. But it does not show up when I type "set" in a dos cmdbox. If I now just open (in windows GUI) the Path env variable Ansible win_path created and click on "Ok" it gets applied and it's available in dos set output.
cukalis there some additional setting I have to provide the win_path module to not just add the variable but also "apply" it somehow?
cukalthe scope is user btw
cukalie: just viewing that ansible created the env var and clicking on OK actually sets it
cukalit's pretty useless if I have to do that manually obviously
cukalIf I log out and log in again the path variable gets set
cukalbut although it's present when created I still need to click on OK in the GUI before it's useable in my current logged in session
cukalhow come?
akdj16Hello! could someone help me?
endresomeone could
endreask smarter questions
petn-randallakdj16: Only if you ask
akdj16indeed, I am searching to get the list of groups, for filling a file, when I am running ansible playbook, however I know only how to get the list of hosts
akdj16how can I get the list of groups located in hosts file? I want to make a loop on this list, with {{groups['all']}} I can only get hosts list
akdj16@petn-randall ?
petn-randallakdj16: No need to highlight anyone. If someone in channel knows, they'll answer. I didn't say I know the answer.
akdj16ah ok,that's fine
akdj16never use IRC tool before... sorry
petn-randallakdj16: Also be a little patient. 95% of the people in here aren't actively monitoring the channel, so it might take a while until they respond.
akdj16thank you
t0kenakdj16: I think you can use the var 'groups'
t0kenshould hold a list of all the groups in the inventory supplied along with each host in each group
t0ken tasks:
t0ken - name: Debug
t0ken debug:
t0ken var: groups
t0kenshould show you
liberforce[m] > liberforce[m]: re-opening issues requires admin permission on the github repository. maybe jhawkesworth\_ can help
liberforce[m]thanks cwegener
akdj16t0ken, I tried {{groups}} , and I get " {'ungrouped': [], u'monitoring_service': [u'local'], 'all': [u'local'], u'l "
jhawkesworth_liberforce[m] cwegener there's no real pattern for running python ansible modules on windows hosts at the moment, so best workaround is to run commands using win_command or win_shell right now.
jhawkesworth_A better feature request might be one that establishes a pattern for running python modules against windows hosts. There are a lot of barriers though - handling the differences between the notions of files between windows and ... everywhere else
jhawkesworth_above is just my opinion though, feel free to raise it with the core team in public core meeting or on #ansible-devel though.
t0kenakdj16: https://paste.ubuntu.com/26541021/ something like that perhaps?
liberforce[m]jhawkesworth_: yeah, I tried to workaround the problem that way, but still, either the pip module would need to cross-platform, or a pip_win module should be available or something similar
akdj16t0ken "{{ groups.all }}" is similar to "{{ groups[all] }}"? if it is, that's not what I want but thank you, I found the variable {{group_names}}
JustASlackerit is the same
agaffneyakihu: {{ groups.all }} and {{ groups['all'] }} are equivalent
jhawkesworth_liberforce[m] there are several other modules which it would be awesome to have fully cross platform git module for example. Its tricky to sovle in a generic way though. If windows came with a default python version then that would be a start!
jhawkesworth_going the other way is effectively porting the python logic to powershell.
JustASlackerId consider whatever chocolate install python does to be default :D
liberforce[m]jhawkesworth_: you could just add a prerequisite, and ask people to install python through win_chocolatey
liberforce[m]on the pip module, you already have virtualenv and pip as pre-requisites. That doesn't sound mush different
JustASlackerand pip is included in python as of python 3.5 iirc
jhawkesworth_all good stuff. I'd imagine you'd still need to specify what remote python to use on windows as not everyone's code is ready for python 3 still.
jhawkesworth_I imagine there would be some modification needed to the connection plugin and perhaps task executor to get this going.
jhawkesworth_I suggest adding it to agenda for windows working group and if it gets some traction there as something people can work on then, maybe put together a proposal
jcaHi, is there a way to use synchronize with a specific user ? I tried to overload rsync_path with su <myuser> -c rsync with no success. (I want to synchronize hostA with hostB with a specific user which has got the right ssh keys). Bonus if file on hostB could be an archive I would be more than happy :-)
jcaThe other way to perform this is to create an archive on A then copy it on B and finally remove the archive on A. I find this quite overkill...
JustASlackerjca: become
jcaI use become
jcaand .. . delegate_to
cresthow many fast tasks should ansible be able to perform per second?
crestwhat is the expected runtime for say 100 small tasks in a playbook if the network latency is below 3ms?
cresti'm just interested in a rough ballpark number
crestbecause my setup feels to slow
crestjust creating a 10 line config file from a template can take a few seconds
JustASlackeransible is not the fastest, especially on startup
crestJustASlacker: i noticed (long ago)
crestbut how fast is it for others?
crestmaybe something with my dynamic inventory script is wrong (yes i do generate a _meta in --list)
JustASlackeralso, async tasks http://acalustra.com/acelerate-your-ansible-playbooks-with-async-tasks.html
boxrickagaffney: I see you are looking at my colleagues hostvars bug.
agaffneybut I haven't looked at the code
agaffneyboxrick: yes, and I've determined that it's probably not a bug so much as a consequence of a deliberate design choice
jamespoOh no, I was worried that might be the case
boxrickI wonder if there is a way to do it once, maybe via ansible.cfg config.
agaffneyto fix it would probably require "hostvars" returning a pseudo-dict that lazy evaluates vars
agaffneysilly IRC client and out of order messages...
agaffneythis is probably a question for bcoca :)
agaffneybcoca: https://github.com/ansible/ansible/issues/33259
boxrickHere is a fix....
boxrick set_fact:
boxrick dns_server_list: "{{ dns_server_list | to_nice_yaml | from_yaml }}"
boxrick4 minutes down to 20 seconds...
boxrickBut thats completely mad
bcocaspeed of hostvars access depends a LOT on the size of inventory (host + vars)
bcocaits lazy loaded for a reason, some use 10GB inventory info, we cannot preload all that, so we 'load on demand' , but we also cache anything we loaded in current run
bcocaso only 1st access shoudl be a bit slow
bcocahostvasr also 'templates on demand' to avoid templating all inventory ahead of time, we only template 'what we use'
boxrickThat sounds good, but the above use case of doesn't seem that way
boxrickuse case* not use case of*
bcocaboxrick: biggest problem with these tickets is that we rarely get actual reproducers
bcocaand sometimes the 'slowness' is unrelated to the reported, not saying that is the case here
boxrickI can put together a whole example if that makes it any easier?
bcoca^ what i did aboe was explain hostvars behavour, not justify 40min template
bcocaboxrick: of what, thought that current ansible had 'fixed the issue'
bcocaat least the posts showed marked improvement in performance
boxrickLet me just gist a quick example to demonstrate one moment
jamespobcoca: https://github.com/ansible/ansible/issues/33259#issuecomment-364136358
jamespoUnless I misunderstand then this is causing the lookup to run twice. When it is not even being accessed
jamespoUnsure if "on demand" above would mean the lookup would only run once, or expected to run twice
bcocano, lookups run each time they are accessed, i said the vars were on demand
jamespoOK cool, just checking that point
bcocathe problem is 'when templating' the 'other vars' might be templated themselves to make their values avialable for 'this vars template'
bcocaso hostvars[host][varname] might force varname2 to be templated 'on demand' to provide context for the template in 'varname'
bcocai.e tempalte(varname, variables=hostvars[host])
bcoca^ so all vars for 'that host' can be tempalted when accessing a var for that host
bcocaif you have an expensive lookup in your inventory def ... you need to be aware of that
kradalbyI would like to select a random host from the given group, i try to do ` hosts: "{{ groups.all | random }}" ` but that does not work giving the hosts an empty list. Does anyone have any suggestions on how i can do this?
jamespoYeah sure. I guess it makes sense if this was done on purpose
jamespoLookups are a slight rabbithole here though, this is also happening to us just for normal variable replacement
jamesposo a host has some_variable: "{{ some_variable_from_group_vars }}" etc
jamespolots of those kicking around, which seems to cause the same issue, where they are all evaluated every time we look into hostvars
boxrickSo I wonder if there is a better fix than this example, which is basically writing it then loading it back in statically...
jamespoMay be exactly the same thing by design, but if so then it hurts people with medium->large inventories and group vars, which is most people that uses ansible for anything serious
bcocajamespo: so you want us to remove lookups?
jamespoNo, I just mean this problem for us isn't just caused by ansible lookups, it comes from normal variable replacement too
jamespoI can understand lookups running every time they are accessed, but not variable replacements
jamespoThe variable might be hardcoded in group vars file so won't change each time it gets accessed
bcocaconfused now
bcocanot sure what you mean by variable replacements nor what runs again
bcocaonce 'templated' values are cached in hostvars
bcocaexcept when there is a lookup, since we dont know if the lookup has constant/variable state when they get called
bcocai.e now: {{lookup('pipe', 'date')}}"
bcocavs set_fact: starttime: "{{lookup('pipe', 'date')}}"
bcoca^ now SHOULD be evaluated each time called, while startime we are evaluating 1 time and saving that value
jamespoYes that makes sense ^
ubermughi there everyone! has anyone ever needed to use ignore_errors to keep a playbook running, but have it increment the failed count in the summary report?
jamespowe only had 1 lookup in group_vars/all which I have just removed so will retest things
jamespoeverything else will just be normal variables e.g. host1 has dns_server: "{{ dns_server_a }}" where dns_server_a is defined in group_vars
lulakHow to override strickhostchecking from inventory? I have ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' in my inventory, but still complains about WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
ubermug@lulak i don't know how to do it from inventory, but i set 'host_key_checking = false' in the ansible.cfg file and that corrected that issue for me
lulakubermug: :/ maybe bastion host is the way... https://github.com/ansible/ansible/issues/9442#issuecomment-291627951
ObaidHey everyone , Has anyone setup AWS ubuntu instances sing ansible ? I am facing problem and I need little bit of help in solving that
ubermuglulak: I have never had to use bastion host before, so I am unfamiliar with that one. In my scenario, I have to rack hardware and get it ready for shipping out, which means i am reusing the same ip's over and over. So I don't need to change how i handle host key checking from playbook to playbook.
imcdonaIs there any advantage of using the systemd module vs the service module to enable a service on startup? eg systemd enabled: yes vs service enabled: yes ?
imcdonaThe only thing that comes to mind is if a system doesn't support systemd you'd use service. Aside from that I can't think of any reason.
jamespoI think the service module uses systemd if possible? ^
jamespo(e.g. use the service one)
imcdonaWhy not use the systemd module since service is going to use that anyway? Cut out the extra step
jamespo"if a system doesn't support systemd you'd use service. Aside from that I can't think of any reason."
jamesposo why not use the one that works for every system, then you won't have to change your code in future
jamespolike using package vs yum/apt modules is the same reason
petn-randallimcdona: The systemd module can do a daemon_reload, the service module can't.
imcdonaTrue. So long as there's no gotcha's
imcdonapetn-randall: Ahh! That makes sense. That';s what I was looking for
petn-randallimcdona: So unless you need systemd-specific things, I'd use 'service' to keep your role as compatible as possible to other systems.
ChinnoDogWhat is the most elegant way to reverse variable precedence in a playbook? I want to call a role. If the role's parameter is defined outside the playbook I want to keep it. If not I want to provide a default.
agaffneyChinnoDog: that's already how it works. provide your role default in defaults/main.yml, and the same var defined pretty much anywhere else will override it
ChinnoDogSorry, I didn't describe it very well. The variable might be defined in the inventory. If it is then I don't want to override it with a playbook variable.
agaffneyyou can't affect variable precedence, only utilize it
ChinnoDogThe best I can think of is to set a variable that uses the default() function to select the actual values I want to pass to the role. Then I call the role with those variables.
ChinnoDoge.g. if the role parameter is called myparameter then I set this -> use_parameter: "{{ myparameter | default(default_parameter }}"
agaffneyyes, if the variable precedence doesn't work for what you want, you can get around it by using different var names and "merging" at runtime
boxrickbcoca: I have uploaded a full example of what is causing us such problems. https://github.com/boxrick/ansible_slow_example I can't use our exact inventory here, but this demonstrates the effect.
bcocaer .. you keep reassinging the same dict over and over to the hosts that already have direct access?
bcocai can see how that casues the slowness , just not sure that is a valid use case
petn-randallChinnoDog: Sounds like you've got the role defaults in the wrong place, then. Don't fight the variable precedence, work with it. :)
ChinnoDogpetn-randall: I can't in this case. The desired values will be provided by Ansible Tower when the playbook is run. I want to provide sane defaults in the playbook if they aren't specified though.
boxrickbcoca: That was just a dirty example to show the slowness, in our real world it isn't that pointless but similar enough to cause a mass of performance pain.
bcocajust a workaround, you could just create the big dict in same file and use yaml anchors, that would ref the same 'data' adn probably save a lot of churning
boxrickDo you have an example of what that would look like?
boxrickI mean a workaround is in that example of rendering it out then loading it back in. But this feels like it needs a better fix since it comes up time and time again as a bugf in ansible.
xerxasHi there !
xerxasis there a way to know which variables files are loaded, in which order ?
rvgatexerxas, i think you only see the end result... which you can see with debug: var=vars, maybe running it with -vvvvv gives you some insight
agaffneyif ansible gives that kind of output at all, it's more likely to show up with ANSIBLE_DEBUG=1 than -vvvv, I'd think
No1_how to replace 3rd octet in the asnible_host value inside playbook ... is it possible?
No1_something like this ... ansible_host = ... i want to replace it too look like
xerxasrvgate: thanks, I tried with debug, but not -vvvv, true , I'll try
petn-randallNo1_: http://docs.ansible.com/ansible/latest/playbooks_filters_ipaddr.html
petn-randallNo1_: You should be able to use the ipaddr filter to manipulate it the way you want.
agaffneyboxrick: I created a PR (https://github.com/ansible/ansible/pull/35913) that "fixes" the slow hostvars access by only templating vars on-demand, but it's probably not "correct"
No1_does it work replacing set_fact: mgmt_ip: "{{ ansible_host }}" | regex_replace('.231') ?? I am getting syntax errors :P
boxrickAh ok awesome.
agaffneyNo1_: first, all jinja filters should be inside the {{ }}
agaffneyNo1_: second, you're using regex_replace() wrong
No1_I included them in {{ }} ... but still no luck tried
agaffneyNo1_: {{ ansible_host | regex_replace('([0-9]+[.][0-9]+)[.][0-9]+[.]([0-9]+)', '\\1.56.\\2') }}
agaffneythat should change whatever the third octet is to '56'
No1_do i have to escape those brackets?
agaffneyno, because this isn't 'grep' :)
No1_i am still getting syntax errors :P
agaffneyNo1_: can you be more specific?
Sp4rKya/W 34
No1_agaffney: https://paste.ubuntu.com/26542198/
agaffneyNo1_: put double quotes around the entire {{ }}
No1_tried that too .. failed ..
agaffneyfailed how?
No1_okay ...worked missed double quotes at the end :P. my bad
No1_can you explain that regex filter ... what does it exactly works.. ([0-9]+[.][0-9]+)[.][0-9]+[.]([0-9]+)', '\\1.56.\\2')
agaffneyNo1_: I can't really teach you regex. you can try plugging it into regex101.com or something
agaffneybut it basically matches something that looks like an IP address, captures the first 2 octets and the 4th octet, and then uses them in the replacement
No1_got it thanks :)
No1_another question ... is there any variable name for alias host to use for in the playbook ... db_server1 ansible_host="10.xx.xx.xx" ... db_server1 is my alias
ertes-wis there something like the 'service' module, but for *creating* services in an init-system-agnostic way?
bcocaertes-w: no, i would say, template
ertes-wok, thanks
No1_thanks bcoca.
MKS2020hi there! a quick question: is there any solution to have a "skel" for a long repeated variables? I mean long variable with subelements
agaffneyif you mean a var with duplicated content, you can have another var with that duplicated content and reference it multiple times in your larger structure, or use YAML anchors/references
MKS2020i mean something like prepared template with all available fields which would be parsed before creation of actual variable. And only non-empty fields after such parse were applied
bcocause tempatle?
agaffneythere's nothing like that built-in. you can use a template like bcoca suggested
zoredacheIs there an example somewhere of what you mean by templates?
bcocalookup('template', 'path to yaml template file') < would template and load at same time
MKS2020bcoca: templates attached to roles AFAIK? I can't use cross-role template, isn't it?
agaffneyyou can technically use cross-role templates, but it's generally frowned upon
bcocaMKS2020: not sure why you cannot use cross role
bcocamakes more sense using 'dependant' roles
MKS2020bcoca: i like that idea, so i can have a single role for the templating and force all other roles to have dependency on that role?
MKS2020but i didn't get how to send different variables to template role itself? :)
EverspaceConceptually I think that's a little wonk. A role should encompass one facet of the deployment.
EverspaceIf you need to vary wildly between different distros, you probably want to include different tasks from main.yml based on what you're doing.
MKS2020here is an example of the variable - https://gist.github.com/ask0n/994f84615f7254fd367c4a8bd2cd9aec
MKS2020the thing is that role which parses this variable accepts huge list of available options. And sometimes this options is used, sometimes no. The idea was to have some skel with all available options for the variable and parse it only for defined fields
zoredacheMKS2020: can you flatten out your data structure, so instead of just one large map it is a bunch of variables you set in the 'defaults'?
MKS2020zerodache: the default won't help a lot, i.e. only 3 of 150 variable fields is common for different environment, other must be set
EverspaceIs there a way to adhoc the run-once option?
ansible_babyAnyone interested in helping a newbie accomplish something, or is there an appropriate Help channel?
agaffneyansible_baby: many people here can help, but you have to tell us what you need help with
ansible_babySure, I have a playbook which runs nc against remote hosts, and I need to log the output with the hostname reference. However whether I run nc local on the remote hosts talking to itself, or using my ansible host against the remote hosts, I cannot seem to view the output which I'm able to see if I simply ssh to host and run the script. Wondering if there is a smart way to go about logging the output of nc ran as an ansible task.
t0kenI think you might want to look at the "register" thing
t0kenshould grab all output from stuff run in that task
ansible_baby@t0ken Thank you, I'll look into that.
chainzis there a way to send multiple commands to multiple groups? i know to use the shell module to send multiple commands to 1 host or group
chainzhow do i specify sending to multiple groups?
bcocahosts: <put groups here:
bcoca - shell: command goes to all hosts in those groups
JustASlackeransible -m ping all
chainzi know all
chainzand i know individual groups
chainzbcoca: i'm talking about running it from the command line
chainzansible dupchecker,scraper -m shell -a "uname -r"
Fadi_Hey everyone, is there a way to tell the ec2 module to create a volume on a condition? As in I want the "volume:" block to be available only when another variable is true?
bcocaer same thing, jsut : separated, not ,
bcocaansible group1:group2 -m shell -a 'uname -r'
Fadi_Anyone? please? :)
chainzthanks bcoca
Fadi_bcoca I'll sacrifice a lamb for you if you help me out
t0kenFadi_: use 'when'
t0kenwhen: some.var
Fadi_t0ken, Ok so here's the role in question. https://gist.github.com/farahfa/f23bceafd4cd9fbc9cab8f6b7ba372fe
Fadi_I want to be able to include lines 23 to 28 on a condition
bcocaFadi_: use ternary('value', omit)?
Fadi_Okay so if I use the omit will it not error out because of the fact that the "volume:" block will complain that there are nothing under that? jw
bcocaomit volume
Fadi_lol bcoca like something like this (see line 23): https://gist.github.com/farahfa/f23bceafd4cd9fbc9cab8f6b7ba372fe
Fadi_That's not gonna work for sure
bcocaer wtf is volume | omit: ???
bcocaFadi_: no, pass a var to volume:
bcocavolume: '{{ varwithstuff|default(omit}}'
Fadi_Thanks bcoca! https://deweybertolini.files.wordpress.com/2016/05/web-happy-lamb.jpg
agaffneythat is a very happy lamb
Fadi_Indeed! :D
bcocaACTION preparse oven
bcocahmmm, lamb chops .....
Sicnusour internet connection is being flaky... can't search google for crap. Trying to find an ad-hoc command to copy a file to a place and set ownership of the file and perm of it. ansible $hosts -m copy -a (this is where I get lost heh)
bcocaSicnus: ansible-doc copy
bcoca^ has owner/group optoins
bcocaand mode
No1_stupid regexxx ...never get this working -grrr-
No1_please help me in making abc3GH78dds-7HJhhw898-jh7788GG67 to abc3GH78dds
SicnusIt doesn't show any command line examples
SicnusOnly playbook
t0kenor r'^(\S+)-'
No1_thanks t0ken: how did I forgot about split :P
No1_but can show me how is it done using regex_replace()
t0kenthis isn't perl, everything doesn't have to be solved via regex =)
No1_no was using regex_replace to replace some variables values so..
t0kengonna have to gimme sample line and text so I can see what you're trying to do
t0kenACTION points to the nearest pastebin
No1_t0ken: https://paste.ubuntu.com/26542815/
t0kenNo1_: I'm confused, are you wanting the first part of the string or are you wanting to replace a part of the string
No1_just the first part of the string
No1_my regex I pasted in the bin ,,, as I am not sure sure which one to use so I was testing that. but need result only the string infront of first '-' in the given string.
Sicnusbcoca: thanks... Sussed it out
t0kenNo1_: https://paste.ubuntu.com/26542901/
No1_haha thanks t0ken: thanks -kudos- I've scratching my head from morning :P
No1_what's the trick over there u used search isntead replace
t0kenyeah, you're basically searching for a piece of text from the string
t0keninstead of replacing some bits with nothing
t0kenbut honestly, would use split. Easier to read, explicit
t0ken'{{ mystr.split("-")[0] }}'
No1_yes..I do agree 👍
EverspaceI prefer {{|first}} instead of [0]
EverspaceBut yea
Dan0maNhaving a hard time trying to figure out how o work with this dictionary: https://gist.github.com/anonymous/344fa1ba3bfde037187d3d266afca993
t0kenso, I see there's a REPL like thing called ansible-console
t0kenI can get into it
t0kenbut...can't quite figure out how to use it
t0kensay I wanted to debug a var
t0kenanyone played with this?
Dan0maNcan anyone help point me at what i'm doing wrong?
larsksDan0maN: you're trying to index a dictionary (hostvars[inventory_hostname]) with another dictionary (modules).
larsksI think you want ...['modules']?
larsksmore explicitly: hostvars[inventory_hostname]['modules']
Dan0maNi'll give it a try
larsksAssuming that you actually have a host fact named "modules".
larsksHow are you assigning that?
Dan0maNhost_vars file
larsksOkay. I think that should work.
No1_I am trying to use line in file ... but failed saying "FAILED! => {"changed": false, "msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"} "
No1_i am using become: yes user: root ... why is it failing?
BManojlovicLOL today i learned ansible-doc :))))
t0kenNo1_: install libselinux-python on thehost
larsksNo1_: well...it sounds like libselinux-python is missing. Are you targeting an selinux-enabled platform?
t0kenselinux is telling you you can't do that
larsksAnd are you using the system python, or python installed elsewhere?
EverspaceYou may have to perform ssh... raw! http://docs.ansible.com/ansible/latest/raw_module.html
larsksNo1_: you can also trick ansible into thinking that your system is not actually selinux capable.
BManojlovicansible -u root -i inventory host -m raw -a "yum install -y libselinux-python"
No1_yeah ai am using cenos6.9 with selinux enabled...but where there is no issue with creating a file with copy why just for line infile?
BManojlovicNo1_: because after change of file it would try to restore selinux context
BManojlovic"change" is not in place
No1_I don't use system python may be the resaon
BManojlovicbut normal package: state=present name.... should be more than enough
BManojlovichmm yes
BManojloviccan you install module ?
Dan0maNNo1_: i believe i ran into this before. the target needs to have that package installed on it
larsks...but it should have it installed by default, unless you're using a python other than the system python.
BManojlovicyes he is not using system one
Dan0maNcentos didn't for some reason. maybe because i was using a minimal
larsksOkay, I missed that. In that case, the easiest solution is to make ansible think you're not using selinux.
jborean93No1_: you need to use some symlinks to link the system selinux bindings to the Python you are using
jborean93Just trying to find a blog post that explains it a bit better
larsksNo1_: replace /usr/sbin/selinuxenabled with a script that returns a nonzero exit code (so "exit 1").
Dan0maNin my case, the target system clearly didn't have it installed. i believe it was cent7 minimal
larsksThat should short-circuit the selinux checks, if I'm reading the code correctly.
TrevorVHello! I'm having an interesting issue... I can't seem to print the contents of a variable with "- debug:"
TrevorVBoth "var: " and "msg: " are being ignored by my ansible script.
No1_yeah symlinks is the best option ... instead of tweaking anything else.
jborean93No1_: here is the post i was mentioning https://dmsimard.com/2016/01/08/selinux-python-virtualenv-chroot-and-ansible-dont-play-nice/
Dan0maNcreating a symlink isn't tweaking?
jborean93it is aimed at running on localhost but the same concept applies
jborean93Dan0maN: better than disabling something that is designed to secure your system
Dan0maNjborean93: yeah, i didn't and wouldn't have done that. i simply installed the missing package
jborean93Dan0maN: the trouble is that package can't be installed on a non system python (I believe)
jborean93So installing it on the system python and then using a symlink so your alt install sees the same package works as long as the versions are the same
Dan0maNthere is a yum package for it
Dan0maN$ cat /etc/centos-release; yum list | grep libselinux-python │~
Dan0maNCentOS Linux release 7.4.1708 (Core) │~
Dan0maNlibselinux-python.x86_64 2.5-11.el7 @anaconda
No1_jborean93: could you point me the blog post about symlink for selinux?
TrevorVNevermind! PEBCAK... syntax was off.
jborean93No1_: https://dmsimard.com/2016/01/08/selinux-python-virtualenv-chroot-and-ansible-dont-play-nice/
Sketch"Okay, so if you inherit site packages, that solves the problem - you’ll get the selinux module in your virtual environment - along with the rest of the globally installed python modules that are installed."
jborean93Dan0maN: there is and it is still required, that yum package will install to the python at /usr/bin/python, this is for a Python that isn't the default system install
Sketchthe easy fix, also from the blgo post
jborean93Sketch: that is the case if you are using a venv from the system python yes
Dan0maNjborean93: ah, okay. i apologize. i wasn't following. i have a virutalenv that is inheriting
jborean93Dan0maN: that's cool, it's not an easy thing to understand. I probably don't understand it myself but this is just what I've done in the past
Dan0maNbut his message appears to be an issue with the target. it wouldn't use a non-system python on the target, would it?
jborean93If someone has a better way or if this is bad advice please speak up :)
jborean93Dan0maN: if you set `ansible_python_interpreter` it could, but by default no
Dan0maNjborean93: got cha
Dan0maNnow back to trying to learn how variables work
JuN1xhi guys
moritzDan0maN: the first thing you should realize that they aren't actually variables, in that you can set them only once
moritzso they are more like constants
Dan0maNmoritz: yeah. sorry. i dabble in programming rather than it being my full-time, so i'm sure i incorrectly use terms ambiguously
Dan0maNi'm trying walk a list of dicts, i believe, but i can't seem to reference them correctly
EverspaceTo be fair, there's some silly neuance. I would probably describe it as const or final
Dan0maNis that what 'modules' is here? a list of dicts? https://gist.github.com/anonymous/d0140729d51e2fb1c5bde44366441ae7
flowerysongNo, that's just a dict.
Dan0maNi keep reading over the 'variables' doc page. i thought that a dict was a single key: value pair
flowerysongA dict is a mapping of keys to values.
dmsimardjborean93: that's one of my most popular blog posts :p
flowerysongIt can contain 0 to N keys.
Dan0maNokay. that clears it up a bit. let me see if i can get this to work now
moritzwhat javascript calls "objects", perl "hashes", others call it "maps"
flowerysongA list is an ordered sequence; the short form uses [] as delimiters, the long form uses '-'.
Dan0maNmake sense. ty, flowerysong
SmashingXis it possible to install multiple packages in one instruction ?
agaffneySmashingX: yes, depending on what type of package. the 'apt' and 'yum' modules (among others) support passing a list to the 'name' parameter
SmashingXaccording to this one is doing one installation
SmashingXbecause I have to install this:
SmashingX yum install php54 php54-mysql php54-devel php54-gd php54-pecl-memcache php54-pspell php54-snmp php54- xmlrpc php54-xml php54-php-mysqlnd
SmashingXI don’t want to have to write a line for each one :/
Dan0maNflowerysong: any thoughts? https://gist.github.com/anonymous/387c31291c4f62891c8a534d16357de2
SmashingXso how can I do thaT?
kiesSmashingX, there is http://docs.ansible.com/ansible/latest/package_module.html but keep in mind distros might name packages differently..
kiesoh you just want to yum install a list of packages?
JuN1xI have a doubt, could you help me ? http://paste.debian.net/hidden/42b65461/
No1_jborean93: worked perfectly ! thanks
Dan0maNSmashingX: http://docs.ansible.com/ansible/latest/yum_module.html - To operate on several packages this can accept a comma separated list of packages or (as of 2.0) a list of packages.
JuN1xthanks if advance
jborean93No1_: don't thank me, thank dmsimard for the wonderful blog post :)
jborean93glad to hear you got it working though
SmashingXDan0maN: The problem is that I don’t see any kind of example doing it
No1_yeah ofcourse
dmsimardjborean93: the tricky part is knowing that some modules, even with the expectation that they run remotely, actually require local operations (ex: template)
Dan0maNtrust, but verify. give it a test on a system you can add/remove packages on
rmstarJuN1x: not sure if this is the best solution, but i used set_facts with when to accomplish something like that
JuN1xrmstar: thanks, I am going to check it
jborean93dmsimard: yep the scope of the problem can be quite problematic, but thanks for the blog post. I've encountered that a few times and that helps spur my memory
SmashingXDan0maN: can you give me a short example? The problem is that I don’t know how the syntax works
Dan0maNflowerysong: nevermind. i sent the with_dict a list by prefixing the modules dict with "-". got it working now. thanks for helping
Dan0maNSmashingX: use any of the examples at the bottom of the page, but instead of only 1 package in the "name:" field, supply it a comma separated list of the packages you want installed
EverspaceSmashingX: I would get familar with yaml.
EverspaceDan0maN: You can provide any assortment of list. I would recommend standard YAML lists however.
SmashingXDan0maN: http://pastebin.centos.org/538976/
SmashingXlike this?
EverspaceSmashingX: Dan0maN: https://paste.fedoraproject.org/paste/-1Io5XfecgaYO2fQqzPUNg
Dan0maNSmashingX: looks good
Dan0maNyeah. that is much cleaner Everspace
rmstarnice! didn't know about the package module :)
bcocapackage is a lie
nitzmahone--^ truth, from the guy that wrote the lie ;)
EverspaceThe grand deception
bcocai wrote what people asked for, not what they wanted
SmashingXoh so is either using commas or like bulletpoints
bcocaie package will pass you package names to underlying package manager, but it wont' figure out' the correct names for each package manager
Dan0maNSmashingX: i think the 'yum' module specifically said to use commas. not sure if it allows lists. the 'package' module supports them
EverspaceI default to package until I encounter a particular bugaboo.
bcocaSmashingX: or you can just pass a var that is a list yum: name='{{mylistofpkgs}}'
SmashingXbcoca: oh with a loop?
EverspaceSmashingX: They are just ways to write out lists.
bcocaDan0maN: any module that uses 'list type' can take both a 'real list' or a comma separated list of items
bcoca^ string
bcocaSmashingX: no, no loop needed
SmashingXbcoca: oh, I ‘ve never used variables
Dan0maNbcoca: so it does support lists? i didn't see it in the docs or examples
SmashingXbut that looks like a good approach
EverspaceTypically you should be putting things in variables so that you can dynamically change things based on what environment you're in or whatever.
SmashingXbcoca: cool, thanks!
Dan0maNbcoca: yeah. what i meant was this doesn't reflect that: http://docs.ansible.com/ansible/latest/yum_module.html
EverspaceDan0maN: " To operate on several packages this can accept a comma separated list of packages or (as of 2.0) a list of packages."
bcocaDan0maN: not showing 'type' but its there
bcoca^ hidden in the description
Dan0maNlol. and... i can't read
bcocawhere noone expects it to be!
Dan0maNlevel 10 HIPS
Dan0maNhell, i think i even copied that earlier. lol
Sketch"When used with a loop of package names in a playbook, ansible optimizes the call to the yum module. Instead of calling the module with a single package each time through the loop, ansible calls the module once with all of the package names from the loop."
Sketchhmm, what do they consider a loop
Dan0maNprobably a with_items
EverspaceHowever, this squashing is being depricated
Sketchbecause i've got some yum: pkg={{item}} ... with_items: and it seems like it runs one command per item
bcocaSketch: ignore, that 'feature' is going away
bcocajsut give name= the list directly
bcocaSketch: cause it is confusing
bcocaonly a 'few modules' support it and its non obvious when they do
Sketchso if you just specify name=list it will run it in one command?
bcocathat is a feature of the YUM module, also apt one and others, but NOT all modules
Sketchhow about the generic package module
Sketchi assume it will just get passed to yum anyway
EverspaceSmashingX: You should get used to variabling. I just have to make minimal adjustments now and I can spin up whole new clusters and the like https://paste.fedoraproject.org/paste/-xgs2BrckssqvZqOG68xqw
Sketch(or apt, whatever)
SmashingXEverspace: are you showing off?
EverspaceEncouraging that you think in terms of variables
Dan0maNEverspace: staticing? :)
Dan0maNEverspace: err, constanting?
EverspaceYou can set_facts on the same facts over and over again.
SmashingXyeah I guess I will get there when I have more experience
SmashingXand skills
EverspaceIt's practice. Generally if you would want to put a thing on a new machine, but slightly differently, rather than write a new playbook, think of the differences and encode them within variables
EverspaceA good example is prod vs. dev, where you might want different files and permissions between the two.
Dan0maNSmashingX: read the best practices. it dives quite well into what Everspace is saying: http://docs.ansible.com/ansible/latest/playbooks_best_practices.html
Dan0maN(i personally feel that should be in the introduction to playbooks)
SmashingXlet me just finish this simple playbook and I will read that
SmashingXnow I need to figure out how to enable a service with ansible
SmashingXand test my playbook
Dan0maNservice module
Dan0maNSmashingX: http://docs.ansible.com/ansible/latest/service_module.html
SmashingXthank you but I was already there
SmashingXthe thing that I have to figure out is if I have to set the state as enabled
SmashingXbecause it doesn’t mention anything
SmashingXoh I see it
SmashingXenabled: yes
Dan0maNalso, there is an example of it in the best practices i think
SmashingXwould that work for systemd as well as for service ?
Dan0maNlooks like it
SmashingXso then ansible would check first if the target is using sysv or systemd before executing the command?
Dan0maNi think that, much like 'package' for 'yum', 'service' is more generic
RicaparI have a question regarding Ansible Tower and Windows.. This is coming from a unix/linux guy that's been thrown into parts of the windows world.
Dan0maNSmashingX: Controls services on remote hosts. Supported init systems include BSD init, OpenRC, SysV, Solaris SMF, systemd, upstart.
RicaparAlready got things working nice and neat for some Linux boxes with Tower, where they hit the bootstrap URL and configure themselves.
agaffneySmashingX: when ansible gathers facts at the beginning of a play, it figures out which is being used and set the 'ansible_service_mgr' var (iirc). the 'service' action plugin then uses that fact to figure out what to do
RicaparTrying to achieve the same for Windows, but I'm still stuck at the authentication part. As soon as the box is brought up, it's not part of a domain or anything else. Testing on a dummy box right now where we manually created a local user account, but I seem to be hitting issues with WinRM. Any one who's used Ansible (with or without Tower?) have any pointers for getting Windows going in a bootstrap scenario?
EverspaceWouldn't you have to do something dirty to get the process started?
EverspaceI haven't really touched windows management via ansible yet.
RicaparIt all seems dirty right now unfortunately :(
agaffneyRicapar: I'm not familiar with using ansible with windows, but I think the winrm bootstrap part needs to be part of whatever pre-ansible automation you're using to bring up the box in the first place
agaffneyit's the same as making sure ansible has a user and trusted SSH key on a linux box
RicaparI think I got that piece - and yeah, they'll certainly need to be some form of account already there it can use, either via the template or otherwise. I think what I'm trying to arrive at is how little I need to do on the template before I can have Ansible take over
agaffneycreate a user and run the winrm bootstrap powershell script
Ricaparon Linux it's pretty easy - we just drop in our management ssh key for root and proceed from there.
spietteanyone got the problem of running molecule on centos in a virtualenv and being unable to have anything running because libselinux cannot be pip-installed?
agaffneythat actually came up in this channel a few hours ago
agaffneypython-selinux isn't pip-installable and your virtualenv probably doesn't inherit from the system site-packages
spietteagaffney: thanks for dmsimard blog post link, hackish, but i guess it will work. I could not get it to work neither with mkvirtualenv --system-site-packages
agaffneyunfortunately, it's not really an ansible problem
spietteno, it's a virtualenv/pip/selinux problem
dtorreswhat would you recommend to write output to a text file. I was using lineinfile module but its reall slow when writing to text file
dtorrescopy module doesnt have an append option
BManojlovicthere is combine module
BManojlovicjust a sec
agaffneydtorres: that's not really something that ansible directly supports
agaffneyappending more than a few lines to a file is not something that often comes up
dtorresyeh im trying to find all files in a directory, get the path and write it to file
dtorreswhat would u recommend on accomplishing that task
agaffneywhat exactly is slow about lineinfile? it should be as fast as any other method
agaffneyand how many times are you using it in a loop (I assume)?
dtorreswell i noticed the difference on how fast the find works and display the output in debug mode
dtorresjust one loop
agaffneycan you gist/pastebin your task(s)?
dtorres - name: query app folder
dtorres find:
dtorres #paths: "/mnt/pinnacles/current"
dtorres paths: "/Users/dtorres/git/repo/pinnacles"
dtorres file_type: "file"
dtorres recurse: yes
dtorres register: find_result
dtorres - name: copy result to txt file
dtorres lineinfile:
dtorres dest: ~/csa_file_path.txt
dtorres line: "{{ item.path }}"
dtorres with_items: "{{ find_result.files }}"
agaffneynot in the channel...using a gist or pastebin
agaffneygist.github.com, pastebin.com, etc.
dtorresoh sry
dtorressure let me get u link
agaffneyhow many results are there from the 'find' task?
agaffneyat a certain point, it might just make sense to do 'shell: find /Users/dtorres/git/repo/pinnacles -type f >> ~/csa_file_path.txt'
agaffneythat's not idempotent, though
dtorres:) yep thats another option
dtorresok let me think this over. thanks
EverspaceIsn't there like... with_directory_tree?
agaffneywith_* only operates on localhost
agaffneyif you are using 'hosts: localhost', then something like that is a viable alternative, but it's the repeated 'lineinfile' invocations that are the slow part
dtorresyeh agree
dtorresthat shell script insanely fast
dtorresI’ll go with that option
EverspaceShell is typically way faster than anything else.
agaffneydtorres: you could potentially use a single 'blockinfile' task and a jinja expression to merge the 'find' module results, but that could get...interesting on a second run
dtorresits cool, shell is fine. its should be a one time run
dtorrestyvm guys.
dtorreshave a good day
kektrainmcirioli specing Und3rf10w nirik tom[] lukasdboer jouty astellwag aakvik urmet kad- xetrov podkilla Stealth xpt zerick gomix monokrome TacoThief zoredache Killsudo DJ_Dichotomy McKraken theacolyte codey toozej iron_houzi jadz0r mkrizek dza hagridaaron packeteer seiyseiy agustafson z0null kungfu
kektrainmgoodwin teun Fluor ar1el colo-work ismaris tumble drewlander Jyrsa^ Arnie dupondje pseudonymous tuxillo GameGamer43 klaas willwh ra1stlin CheBuzz Gaetan hexa- Psy-Q ghormoon endre kokel shtirlic ju5t Merry__ Snafu lieter Hunger- acrocity a_storshoo pikolinosimo harmw chris| devyani7 lauer plopix
kektrainbigjust protodan adray Arrfab logan- GNU\colossus Callek champain kambiz plonk detha andol hubcaps kline deanman CobHead vmnic6 vimclippy gwenael pstk spredzy henk Tamwyn aptanet chaas kukacz hax404 bordel Virtual-Potato jcara muo jpaulovi rcarrillocruz Brainspackle Calvin` malevolent flaper87
kektrainverdurin a13x212 desnudopenguino Jeffrey4l roukoswarf Groenleer rbott systemdave kinlo blu FooBar Pomidora ThomasJ|d mlehrer l ChinnoDog phin t0ken fridim blazeme8 lkoranda ashka flowerysong simmel psauxwf spk ssbarnea hazmat regtools jp11 mhayden uidzer0 kradalby traxo-xx foxmask Attoy cor Methos
kektraingregwork pizzaops mattclay ghavil catmando burn jweaver joker234 omniuwo Zhenech dag- stux|work sjk nadley flor oahong igniferroque j3roen nwonknu tec__ heatm1s3r Hilli thxffo MANCHUCK halberom apollo13 m_3 kp permalac Jeeves_ honestly jongep86 eripa andrewschoen Walex roger_rabbit JoNaZ jimbo_
kektrainkushal systo stux16777216Away Spaulding donut_ fl3sh moss heffer r0bby [diecast] Pistahh cherti Jmainguy serverascode petems boxrick dlamotte feltnerm kierank docschick chouseknecht ToeSnacks thaumos frdy si14 hessu parshap futuredale mubix RasnCain madonius kklimonda Hatsjoe wloncom breitenj
kektraingeofft evrardjp JiYu_ seprob rub gregab SegFaultAX jmccrory classicsnail MaZ- tonyyarusso andreaf sipior jmsx mkereczman swebb ruairi Juri_Agarin dotplus rdz bwn dazo averell jonathangee Strix nix|monkey Chrisz filotek twittyc inire emk varesa| elysium Captain_Beezay jhill_ fxfitz djural Nebraskka
kektrainklow wizonesolutions souterrain flyinprogrammer nand0p pmbauer JoWie blinky42 cheesesashimi flyingfred0 masteinhauser Cody___ sdoran dignus crane cheGGo Guest92923 neferty mattcode atosatto BloqueNegro n-st Zart filler StoneWaves johto inetpro F14W3D asyd Nothing4You_ akshayg96 N1ght0wl TheCowboy
kektrainvoja sparky_005 agaffney schaary futilago klep theShirbiny perigrin psycobass Quimby simbalion nethope SamYaple ahammond dron23 svg kormat pdellaert sgsabbage Pixelz juststrollingin grumble msil larsks orc_fedo muep bviktor _3onyc mr_kyd LippyLee el andecy vmonteco cverna babilen akihu FrozenFire
kektrainjellyfrog Pennth Larsen_ dlb76 hugokuo jlmitch5 raktajino Cybergeek jpmens max-b Gnitset _quadDamage ouzo12 MrFahrenheit Death_Syn y_storshoo cloudnull nadersith odyssey4me noodl Mickey8083 pmden xerxas xoraxiom trippel marcinkuzminski CuriousLearner Klawfinger cootcraig Jeff_S yoink saybeano
kektrainhkraal tetra llua thana maedox otti anthony25 karlthane _NiC magnetik sarlalian stryx` Frickelpit Necrosan nowayz75 remex phips Xat` wAmpIre Pierreee raatti ar timeless finster lucasrolff leifmadsen delhage mpjetta carsonfull A-Kaser MsMouse pegmanm dnl kalcy ptone Sketch specialkevin speedmann
kektraindober likewhoa JasonO shodan45 tpr nicoulaj ujjain- Neighbour maciek cmosguy gildegoma2 hiroki ejsf fredrikhl Karnus dmsimard jfrankowski reda minus awestin1 djanatyn rbergeron Igglybuff elektrix SirScott nebben nkuttler elricsfate nated brainslug robotpanic pcg KevinTM xaeth etank dirn tibbs mdk
kektrainkubrat rome_390 abstruse gertvdijk d0137_ peerst mikedep333 square1 kedarX torshido DMarby jtanner belak linuxdynasty MichaelBaydoun Awesomecase nickstenn caleban omnigoat AppStore gregdek neith dham1 hlieberman worstadmin CARAM___ bbhoss jefferai weezhard Emenems RedW shaytan Guest52286 xMopx
kektrainfredsted^ wistof notsaG mag_ matburt drybjed notR yaMatt Ironhand helldorado Guest46016 humerusj jkonecny ehelms survietamine solos catern ndonegan_ JohnPreston72 hughsaunders ekakela gadams Sp4rKy moritz Horgix lukegb chrisml bgray jtabor wybczu nant ikonia cornfeedhobo MaartenK rodrigods e
kektrainl_robin tmz smlb loeken pescobar jmosco gperiard m0ltar Hoosilon shadoxx mcdonc renard_ warp holsta TheLugal setkeh tmbg jalcine pulec tru_tru jennings mac_nibblet trishnag daniel0x3 arkin steveeJ lassizci tty00 esrax beasty_ r04r Roelt nigelb Nemie anderson Deiz Badgerpoo2 uZer42 absolutejam
mkereczmanI don't understand why...
raktajinofound the nazi
agaffneyyeah, there was no point to that. there wasn't even a spammy youtube URL or anything
endrei would came after the nicks i guess
perigrinthey'd left it in the /part
r04rthat just looks like bork
mkereczmanwell, hows everyone doin' today ;)
r04ranyway anyone use the open source version of Tower?
jtannerr04r: #ansible-awx
agaffneyr04r: most of the people in #ansible-awx :)
r04rdidnt know it had its own channel
r04ri am still open to anecdotes or reviews ;)
agaffneyyou can get those over in #ansible-awx
agaffneyit's a much smaller channel, and everyone there (presumably) uses AWX
ChinnoDogPointless highlighting. :/
shodan45IKR? at least try to sell me something.
Dan0maNoh, sweet. i didn't know that RH finally open sourced tower!
mmercerlol, its been open source for a few months now
BloqueNegroopen source ansible tower?
mmercerAWX -- its on github
mmercerruns inside a docker container
BloqueNegrothought awx is something different?
Everspacetower is secret sauce over awx
BloqueNegrooh nais
mmercersince when ?
Dan0maNyeah. i haven't looked at ansible since late 2016 until now
mmercerAWX is the upstream of ansible tower
BloqueNegroinstalling via clone repos and running docker containers
BloqueNegropls no :/
Dan0maNi thought the same at first, BloqueNegro, but now it is going to give me a reason to dive into the docker fun
BloqueNegrooh gawd
BloqueNegroit still depends on docker-py
BloqueNegrowhich is deprecated since forever
EverspaceI consider downstream typically as a means to make "secret sauce". Lots of open source based stuff is like that "here's what we use". but that's my view on it mmercer
BloqueNegroand will crash your docker-machine installation
bcocaopensource tower .. that is sooo last year ....
bcoca #ansible-awx <= irc channel
mmercerACTION nods at bcoca
Everspaceawx is something that's on my to-do list.
Dan0maNman, you can almost hear them grumble when it is mentioned :)
bcocaEverspace: the 'secret sauce' is 'logos and support'
mmercerBloqueNegro: there are a few folks that have attempted to extrapolate it from docker
BloqueNegrousing docker-py would probably be a no-go for me
EverspaceI think that's a type of sauce. Not a very fancy one though :^)
bcocanot very secret
Everspacehence the scare quotes
bcocabut that is basic difference between aws and tower, you get diff logos and one lets you use RH support staff to help you
mmercerwhich really, support just comes down to prioritization -- for the most part the team here at ansible is pretty responsive, as is the community
mmercerprioritization and 'gaurantee' i suppose ?
BloqueNegrothey even encourage you to use docker-compose, even though the latest version will break bc docker-py
bcocammercer: difference is 'supported by volunteer' vs 'supported by person you are paying'
mmercerbcoca: do you guys not respond to questions about awx in general? i havent lurked in that room, id have figured you treat that room the same as this one, at which point, many of you are are pretty responsive and community engaging ( not saying you're required to be, or that you 'have to be' or anything, just that it is a nice feedback loop)
EverspaceI think I wasn't looking at tower because this office didn't have any way for me to stand up services that are exposed to the outside.
Everspaceor awx more specifically
mmercerthough, i suppose thats also where the 'expectation' is different -- in here, you may not be able to get an answer or support response, depending on the scope/difficulty/etc, with official support, you will get that answer
bcocammercer: I DONT .. but im not awx expert .. have not used it in 3yrs ...
mmercer* nods *
bcocaalso community size, lots more 'ansilbe' users, has been out there longer as oss project, though currently smaller, awx has good comunity and growing