Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-02-05

| Channels | #salt index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:07 stooj joined #salt
00:38 eThaD joined #salt
00:56 ivanjaros joined #salt
00:59 mTeK joined #salt
00:59 mmidgett joined #salt
01:02 swa_work joined #salt
01:04 byteriot left #salt
01:12 viccuad joined #salt
01:12 denys joined #salt
01:13 mTeK joined #salt
01:14 scsinutz joined #salt
01:15 swa_work joined #salt
01:15 mTeK joined #salt
01:17 KaczuH joined #salt
01:20 mmidgett joined #salt
01:20 eThaD joined #salt
01:25 jas02 joined #salt
01:29 denys_ joined #salt
01:41 eThaD joined #salt
01:56 denys_ joined #salt
02:04 viccuad ok this is silly, but… how does one make an sls state call another sls state?
02:05 viccuad I have written /srv/salt/profile/workstation.sls, and I want that state to call /srv/salt/profile/dotfiles.sls
02:05 viccuad and `include\n  - profile.dotfiles` doesn't work
02:11 catpiggest joined #salt
02:12 ntropy viccuad: that should be enough.  can you share more details, your dotfiles state and the state you're including it in?
02:14 viccuad ntropy: well, it worked, so I suppose I mangled the syntax at some point. sorry for the noise :/
02:16 khaije1 joined #salt
02:18 khaije1 to build/run a custom dockerfile, is there a way to do that in a single stanza?
02:20 scsinutz joined #salt
02:20 beardedeagle joined #salt
02:23 eThaD joined #salt
02:26 jas02 joined #salt
02:35 fracklen joined #salt
02:48 ilbot3 joined #salt
02:48 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.3.5, 2016.11.2 <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ (please don't multiline paste into channel) <+> See also: #salt-devel, #salt-offtopic <+> Ask with patience as we are volunteers and may not have immediate answers
02:58 viccuad is it possible to use file.managed to put a tree of files in a folder, without caring how the tree looks?
03:00 _beardedeagle joined #salt
03:00 _beardedeagle joined #salt
03:01 Eugene viccuad - "recurse"
03:04 scsinutz joined #salt
03:04 viccuad Eugene: thanks :)
03:06 scsinutz joined #salt
03:08 Armageddon joined #salt
03:09 Armageddon I've been trying to get to learn more about Salt, but I can't figure out how I can find information about a user on a machine and if there is an easy way to print that information (simulate it) ?
03:16 swa_work joined #salt
03:23 qwebirc44461 joined #salt
03:26 pnijjar How do I troubleshoot Jinja renderers? In particular: how do I see the values of the items Jinja is trying to process?
03:27 pnijjar eg I get this message when I call salt-call state.sls: "Rendering SLS 'base:localbackups' failed: Jinja variable 'tuple object' has no attribute 'name'". If I could see what the tuple object Jinja sees is, then I could troubleshoot much more effectively.
03:27 jas02 joined #salt
03:33 ntropy pnijjar: yeah i know your pain.  not sure if there's a better way, but i'd just print the tuples and lists with {{ var }} in a file to see what their contents are
03:39 manji joined #salt
03:40 demize joined #salt
03:41 Tanta joined #salt
03:41 Xevian joined #salt
03:46 pnijjar ntropy: Okay. That's something. Thanks.
03:59 prg3 joined #salt
04:13 st8less joined #salt
04:15 st8less joined #salt
04:24 cyborg-one joined #salt
04:32 saltnick joined #salt
04:32 thebinary joined #salt
04:34 saltnick Hello, is there a way to execute a task on another minion, like in ansible?
04:39 swa_work joined #salt
04:40 armyriad joined #salt
04:46 swa_work joined #salt
04:48 chowmeined joined #salt
04:56 cryptolukas joined #salt
04:58 swa_work joined #salt
04:59 pcn you mean for one minion to reach out to another minion?
05:06 evle joined #salt
05:42 debian112 joined #salt
05:53 eThaD joined #salt
05:58 jas02 joined #salt
06:01 pcn If you just mean "Run some command", it's  really simple:
06:01 pcn # salt 'minion-name' cmd.run 'the-command'
06:14 eThaD joined #salt
06:21 stooj joined #salt
06:50 preludedrew joined #salt
06:52 fracklen joined #salt
06:52 mavhq joined #salt
06:56 eThaD joined #salt
07:00 omikron88 Hi All,
07:01 omikron88 I'm having some issues with my salt-cloud configs .. I'm using VMware and vmware templates. When i provision a new VM from template and customise it, the hostname is not FQDN, instead it's a shortname. I've searched and searched but I can't figure out how to set the hostname to my FQDN. Thanks in advance.
07:02 omikron88 (I've tried setting FQDN in my cloud map files, but all that does is create a VM with the FQDN, the machine itself is still shortname)
07:26 debian112 joined #salt
07:44 toki joined #salt
07:47 toki Hello! I have a question about using salt['cmd.run']('blah') within a Jinja2 variable assignment. Would anybody be willing to assist me?
07:48 debian112 joined #salt
07:51 toki nvm I figured it out
08:06 debian112 joined #salt
08:09 justanotheruser joined #salt
09:01 eThaD joined #salt
09:05 jas02 joined #salt
09:10 evle1 joined #salt
09:23 eThaD joined #salt
09:44 rabelais joined #salt
09:53 rabelais I'm working through the pillar walkthrough and have the users example working. I wanted to try to view the pillar data via the cli. "salt '*' pillar.items" and lists everything, but "salt '*' pillar.get users" doesn't do anything useful. Why not? I'm trying to extend the structure of the users pillar, but I don't understand the way the pillar.get function works to access the data (beyond the example in the walkthrough, and even that barely)
09:59 AndreasLutro rabelais: that just means none of your minions' pillar files/sources have the "users" key defined
10:01 rabelais I don't think that's the case, since pillar.items returns the data, and the users are being setup in the passwd files of the minions
10:04 AndreasLutro if you're 100% sure the users data is located at the "users" key at the root of the pillar data
10:04 AndreasLutro I do remember an edge case where pillar.get and pillar.items uses different cached data
10:04 AndreasLutro try saltutil.refresh_pillar
10:05 eThaD joined #salt
10:05 rabelais oh wow, that did it
10:06 rabelais thanks!
10:27 viccuad joined #salt
10:39 sagerdearia joined #salt
10:41 tellendil joined #salt
10:42 tellendil Hi, I'm looking to create a state that ensures that no file with a given pattern exist on my system (but don't delete it if they exist, just list them). What would be the best way of doing such a state ?
10:43 cryptolukas joined #salt
10:47 viq tellendil: if you're planning to run the state from schedule - list them where?
10:49 tellendil viq: stdout would be ok I guess, I'm for now running things manually, but if there is a better way of doing it, I would gladly change :)
10:50 viq There is no stdout if you're running from schedule
10:50 viq So you'd need to use some specific returner
10:51 viq As for how to find those files, I'd say you'll need file.find https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.file.html#salt.modules.file.find executed from saltutil.function https://docs.saltstack.com/en/latest/ref/states/all/salt.states.saltmod.html#salt.states.saltmod.function
10:52 tellendil joined #salt
10:52 viq But be aware that'll take quite a while, since find needs to crawl through all filesystems to check for presence of files.
10:52 tellendil viq: would you have a good example where I could find this ?
10:52 viq Find which?
10:53 tellendil viq: oh sorry, I had a deconnection, so I didn't seem to receive one of your messages. I was asking about the returner
10:54 tellendil and it doesn't matter much if it takes quite long (it's to find .rmp{save,new} files, to make sure I have up to date configurations)
10:54 viq https://docs.saltstack.com/en/latest/ref/returners/all/
10:55 viq Oh, just /etc then, so it shouldn't take *that* long
10:55 viq Especially if you tell it to *not* follow symlinks
10:56 tellendil right. So the best would be a thing like cmd.run and special outputter ?
10:56 viq https://docs.saltstack.com/en/latest/ref/states/all/salt.states.schedule.html has examples of running scheduled states with specified returner
10:57 viq Nah, as I said, you could write a state using saltutil.function to run file.find, and that would output to stdout. Then you could have a schedule that would run it, and use eg smtp returner
10:57 viq Or you could write a simple script and stuff it in cron
10:58 tellendil viq: ok perfect, I will look at this :) thanks a lot !
11:02 orianbsilva joined #salt
11:07 jas02 joined #salt
11:23 APLU joined #salt
11:42 orianbsilva joined #salt
11:43 fracklen joined #salt
11:51 ivanjaros joined #salt
12:00 barmaley joined #salt
12:10 eThaD joined #salt
12:25 fleaz joined #salt
12:32 eThaD joined #salt
12:41 fracklen joined #salt
12:43 austin_ joined #salt
12:57 candyman88 joined #salt
12:57 stooj joined #salt
13:08 jas02 joined #salt
13:14 eThaD joined #salt
13:15 fracklen joined #salt
13:17 viccuad is there a way to get the name of the current state
13:18 viccuad or the parent state? {{ sls }} ?
13:18 viccuad thanks in advance
13:18 fracklen joined #salt
13:21 Flying_Panda viccuad you mean the system highstate ?
13:23 viccuad Flying_Panda: nope. I'm writing a foo state that is called by another bar state (in fact a lot of foos), and I would like to have the id of the foo state contain the bar string programatically
13:24 viccuad I'm writing the foo states in bar.sls, and I want the foo state ids to contain the bar id, as in `bar_foo`
13:26 viccuad because I want to reuse the foo states in fuu.sls, but if I do their ids are going to collide, so I was thinking on prepending the parent state id to the foo states
13:26 Flying_Panda could you not just do an include then ?
13:27 viccuad no, because they differ in their contents. They are appending things to multiple files, each bar_foo and fuu_foo appends different things, but does it in the same file
13:29 Inveracity joined #salt
13:31 viccuad I guess {{ sls }} is good enough, albeit a bit large
13:32 Flying_Panda I have no idea, never ran into this issue myself when I need things to conflict I just append a sha256 sum of ms since epoch to 10 places
13:33 Flying_Panda because lazy :p
13:36 Flying_Panda mind you I generally write all the shared stuff in 1 file then all the little stuff in another file calling the big one as a dependency Ive never needed to append numbers to state ids
13:45 fracklen joined #salt
13:46 fracklen joined #salt
13:54 austin_ ive added source_hash to my managed file via s3
13:54 austin_ however the hash keeps changing
13:54 austin_ ?
13:55 austin_ so it always fails
13:55 austin_ anyone see this before? s3 setting im missing? ive checked it against the etag of the obj
13:56 jas02 joined #salt
14:21 KaczuH joined #salt
14:23 mikecmpbll joined #salt
14:31 XenophonF austin_: how are you accessing s3?
14:31 XenophonF via the salt file server or directly?
14:32 XenophonF in the former case you shouldn't need a source_hash
14:32 austin_ XenophonF: i have s3fs setup
14:32 austin_ so s3://
14:32 XenophonF in the latter the source hash shouldn't change
14:32 austin_ am i doing this worng? i assume i am
14:32 austin_ no matter way i do the hash keeps changing on me so i can't pull it down
14:33 XenophonF no either is fine, they just have different use cases
14:33 XenophonF i mean if the file doesn't change in s3, the hash shouldn't change
14:33 austin_ the s3 file is not changing.
14:33 XenophonF salt-minion will download the file first, then verify the checksum
14:34 austin_ yea that seems to keep chaning on hash verify
14:34 XenophonF hm, let me check my config here
14:34 XenophonF istr setting up s3fs myself a while ago
14:34 XenophonF just a sec
14:37 austin_ XenophonF: https://gist.github.com/austinpapp/469b0266e318b0e2e2965a157297836e
14:38 XenophonF austin_: wait - did you say that you configured s3fs but are using s3:// URIs?
14:38 austin_ ah so thats wrong?
14:38 XenophonF yeah
14:38 austin_ ugh
14:38 austin_ ok
14:38 XenophonF s3fs is a back end for the salt file server
14:38 austin_ <-- new to salt really :)
14:38 XenophonF https://docs.saltstack.com/en/latest/ref/file_server/all/salt.fileserver.s3fs.html
14:38 austin_ salt:// ?
14:39 XenophonF yeah
14:39 austin_ so does it follow the same path?
14:39 XenophonF assuming you did a single bucket per environment a la s3.buckets: {base: [bucket-name-here]}
14:39 austin_ yea
14:40 XenophonF and assuming you have a file called s3://bucket-name-here/prefix-name-here/filename-here
14:40 austin_ btw, this seems to be a same issue with pillars
14:40 XenophonF the salt URL looks like salt://prefix-name-here/filename-here (for the base environment)
14:40 austin_ and that is driving me insane as well
14:40 austin_ my file is: s3://deployment/dev/certs/server.key
14:40 austin_ which i do see it copy down
14:41 austin_ and is available to cache
14:41 austin_ but it was actaully getting the file that seems to be what i'm missing
14:41 austin_ Comment: Source file salt://deployment-data/development/certs/server.crt not found
14:41 austin_ which has been my issue
14:41 austin_ which lead me down wrong paths :(
14:41 austin_ ha
14:41 XenophonF gotcha
14:41 austin_ led*
14:42 austin_ [INFO    ] deployment-data - development : development/certs/server.crt
14:42 XenophonF the changing source_hash is likely because of the error message returned in the s3 api call
14:42 austin_ that looks ok to me
14:44 austin_ its definitely in s3cache
14:45 austin_ is there a master config i'm missing with s3fs ?
14:47 XenophonF possibly
14:47 XenophonF did you add s3fs to the fileserver_backend list?
14:47 austin_ yes
14:47 XenophonF are you using instance role credentials or an API key?
14:48 austin_ user api key
14:48 XenophonF if the latter, did you set s3.keyid and s3.key in the master config?
14:48 austin_ yes
14:48 XenophonF did you set s3.buckets?
14:48 austin_ yes
14:48 XenophonF are you using environments?
14:49 austin_ https://gist.github.com/austinpapp/6248a6f9cafce8c8ce645ab63b975da5
14:49 austin_ no
14:49 austin_ just single env of base
14:49 austin_ am i expected to use environments ?
14:50 XenophonF no - but s3.buckets is a dictionary with a single key, base, which has a value of a list with your bucket as a list entry, right?
14:50 XenophonF so look at https://docs.saltstack.com/en/latest/ref/file_server/all/salt.fileserver.s3fs.html
14:50 XenophonF it should look like the first s3.buckets config example
14:50 XenophonF only instead of a key named "production", yours is called "base", right
14:51 XenophonF oh sorry let me look at your gist
14:51 XenophonF ah
14:51 XenophonF ok so you're using multiple environments per bucket
14:51 austin_ hmmmm
14:51 XenophonF OK so have you laid out the bucket contents per that doc?
14:51 austin_ env was based on what i pull from grains
14:52 austin_ i did nto necessarily map it anywhere in configs
14:52 XenophonF so you should have s3://deployment-data/base/development/certs/server.crt
14:52 austin_ is that part of the issue ?
14:52 austin_ let me try that
14:52 XenophonF b/c you're using a multi-environment bucket, you have to arrange things as follows (from the doc linked above):
14:52 XenophonF s3://<bucket name>/<environment>/<files>
14:55 XenophonF austin_: this is what my s3 salt-states bucket looks like - https://gist.github.com/xenophonf/b8155b48295d594e5aa1f0255a21ef02
14:55 XenophonF (note that my base environment is empty)
14:55 austin_ ok let me check that out
14:56 austin_ so you are setting multiple envs per bucket
14:56 XenophonF so my production minecraft server would deploy the latest spigot jar using the following URI: salt://spigotmc/files/spigot-1.11.2.jar
14:57 XenophonF yes, same config as you
14:57 austin_ and where are you defining that production setting ?
14:57 XenophonF it's an environment
14:57 austin_ thats where i thik i'm confused
14:57 XenophonF in your mind, mentally translate that directory name to "base"
14:57 XenophonF and it will match your setup
14:58 XenophonF here - i've updated the gist
14:58 XenophonF so in the revised config, it's just using the base environment
14:59 XenophonF again, the salt URI is the same
14:59 XenophonF salt://spigotmc/files/spigot-1.11.2.jar
14:59 XenophonF (if you aren't using environments, everything is in the "base" environment)
14:59 austin_ ok
14:59 XenophonF brb
14:59 austin_ yea i was having a grain do that for me
15:00 austin_ yea. sadly i need to run. bu tthanks for the help!
15:05 jas02 joined #salt
15:06 KaczuH joined #salt
15:19 eThaD joined #salt
15:36 mibr0 joined #salt
15:39 swa_work joined #salt
15:42 khaije1 joined #salt
15:43 khaije1 Hi all, I asked a question about building docker images with salt yesterday but got disconnected. In case anyone else had the same question, here's the answer I found: https://docs.saltstack.com/en/latest/topics/tutorials/docker_sls.html#docker-sls
15:48 swa_work joined #salt
15:56 pppingme joined #salt
16:00 Tanta joined #salt
16:05 KingJ joined #salt
16:08 swa_work joined #salt
16:15 swa_work joined #salt
16:22 stooj joined #salt
16:27 KingJ joined #salt
16:36 netcho joined #salt
16:50 austin_ XenophonF: ok ok ok. so it now works. awesome! thanks for  the help. starting to wrap my head around this a bit more which is obviously good
16:50 austin_ now just need to sort out pillars on s3
16:52 barmaley_ joined #salt
16:54 scsinutz joined #salt
17:05 eThaD joined #salt
17:06 jas02 joined #salt
17:10 Poppabear joined #salt
17:10 Poppabear joined #salt
17:32 XenophonF joined #salt
17:47 eThaD joined #salt
17:49 XenophonF austin_: glad to hear it's working for you
17:49 JohnnyRun joined #salt
17:53 APLU joined #salt
18:03 sh123124213 joined #salt
18:07 ivanjaros joined #salt
18:10 APLU joined #salt
18:12 cyborg-one joined #salt
18:29 eThaD joined #salt
18:44 fracklen joined #salt
18:49 Lionel_Debroux_ joined #salt
18:49 jas02 joined #salt
18:50 eThaD joined #salt
18:56 Freek left #salt
18:59 swa_work joined #salt
19:07 ksoviero joined #salt
19:08 ksoviero Is there a way to have per-host pillars without having to add each one-by-one to the top file? I'd like to just have a hosts/ directory with hostnames inside and when a minion runs it gets it's pillar data from there automatically.
19:11 rabelais can you use a jinja template over a for loop and iterate over the hosts?
19:12 ksoviero rabelais: Perhaps, but the biggest problem I'm running into is that hostnames have dots in them, so an example path like pillar/hosts/salt.prod.kviero.com.sls will throw an error, and I'm not sure how to get around that.
19:13 sh123124213 joined #salt
19:13 sh123124213 joined #salt
19:18 rabelais yea, I remember reading something about the matching system not being happy with extra dots before the final file extension, can you use dashes instead of dots?
19:32 eThaD joined #salt
19:35 debian112 joined #salt
19:39 lorengordon joined #salt
19:47 orianbsilva joined #salt
19:56 toanju joined #salt
19:57 debian112 joined #salt
20:00 cmdrsizzlorr joined #salt
20:00 djgerm joined #salt
20:03 heyimawesome joined #salt
20:14 eThaD joined #salt
20:19 debian112 joined #salt
20:35 eThaD joined #salt
20:36 fracklen joined #salt
20:39 fracklen joined #salt
20:39 debian112 joined #salt
21:04 viq ksoviero: yes, you can, you could have in top.sls something like '*':\n   - hosts/{{ grains['id']|replace('.', '_') }}\n  - ignore_missing: True
21:05 viq and in the case above you'd need salt_prod_kviero_com.sls
21:08 CeBe joined #salt
21:09 rabelais I'm trying to decide what the right way to represent pillar data is, building off the users example in the pillar walkthrough
21:10 rabelais I'm trying to add something like ssh-keys to each user, is the right thing to just nest additional keys under each user?
21:10 rabelais should I redo each user and make them an item in a list?
21:10 viq While I'm pondering whether to start playing with something like varstack or reclass instead of plain pillars and top files
21:11 viq For users I'd actually be tempted to base that off of LDAP data
21:13 rabelais I have very few users (less than 20), so I'm comfortable with just a flat file for now
21:14 foundatron joined #salt
21:15 viq If you want to vary which users are present on which servers then having a file per user and then other states grouping them would make sense
21:15 rabelais sounds reasonable, thanks  :)
21:16 jagguli joined #salt
21:16 viq Otherwise, a single flat file should work.
21:17 fracklen joined #salt
21:17 eThaD joined #salt
21:31 djgerm joined #salt
21:32 jas02 joined #salt
21:33 _KaszpiR_ joined #salt
21:33 diagnostuck joined #salt
21:37 cyteen joined #salt
21:53 fracklen joined #salt
21:53 snc joined #salt
22:10 bbrelin1 joined #salt
22:11 Tanta joined #salt
22:11 bbrelin1 Hello all.
22:11 bbrelin1 I've posted this to the mailing list, but I figured I'd also ask here.
22:11 bbrelin1 I've got an Intel SkullCanyon NUC which I want to use to provision a number of VM's with virtualbox and then manage them with Salt.
22:12 bbrelin1 I'm trying to figure out how to automate this.  I.e. I want to have salt do the following:
22:12 bbrelin1 Create and spin up the VM
22:12 bbrelin1 Install the salt-minion package
22:12 bbrelin1 (oh, install Ubuntu 16.04 first from my USB drive()
22:12 bbrelin1 and then install specific packages.
22:12 bbrelin1 Should I be using salt-cloud for this?
22:13 bbrelin1 I've used the virtualbox.conf file from the saltstack docs but I get an error saying that it can't find the virtualbox driver.
22:13 bbrelin1 Even though VB is installed and i've already created one instance.
22:14 bbrelin1 Any ideas on how to proceed?  Ideally I'd like a pointer to some documentation.
22:16 bbrelin1 Is anybody on?
22:17 brd joined #salt
22:22 ozux joined #salt
22:25 fracklen joined #salt
22:26 manji joined #salt
22:28 djgerm with recent improvements with salt-cloud to leverage virtual box, I imagine you can do all of that with salt-cloud, and have some coworkers who have has success with this approach, but unfortunately I have nothing but 3rd hand knowledge on the matter
22:33 jas02 joined #salt
22:41 WKNiGHT joined #salt
22:42 c4rc4s joined #salt
22:43 smakar_ joined #salt
22:46 CaptTofu joined #salt
22:46 simonmcc joined #salt
22:47 shawnbutts joined #salt
22:51 mosen joined #salt
23:13 sh123124213 joined #salt
23:23 eThaD joined #salt
23:34 jas02 joined #salt
23:44 eThaD joined #salt
23:54 cyteen joined #salt
23:56 debian112 left #salt

| Channels | #salt index | Today | | Search | Google Search | Plain-Text | summary