|
I'm not sure this is the right place to ask this but I'm working with ansible and trying to learn a little about facts, and I'm wondering why this:code:
- debug: msg="{{ ansible_default_ipv4.alias }}" does work, eg: code:
|
# ¿ Oct 20, 2017 23:35 |
|
|
# ¿ Apr 27, 2024 01:51 |
|
Yep. I've noticed that running that type of filter, looking for a "nested" (not sure if thats the right word) fact within a fact doesn't seem to work as an ad-hoc command for anything I've tried. eg this works fine: code:
post hole digger fucked around with this message at 00:11 on Oct 21, 2017 |
# ¿ Oct 21, 2017 00:03 |
|
There it is... thank you. I looked at the module page but I glossed right over that
|
# ¿ Oct 21, 2017 00:16 |
|
Is Spacewalk still relevant as a package management system? we run a pretty... dated... software mangement and distribution system for cent7 and I'm seeing how to best replace it. Our main goal is to have all of our systems running the same versions of software. We don't do any fancy containerization yet and use cobbler for provisioning. Is building an internal repo still something people do? I've also seen Foreman but it seems... sprawling and we'd really only need the package/repo management part of it for now. Is there a newer open space project based on Satellite? Pulp also looks interesting. I guess I'm just looking for ideas or suggestions as to what other people are doing for this.
|
# ¿ Mar 17, 2018 00:59 |
|
can anyone recommend a podcast app for fedora? ive tried vocal and its a buggy pos
|
# ¿ Jul 2, 2018 22:51 |
|
For how long has Centos had security errata in yum (ie yum --security update)? I thought that was a RHEL only thing and was surprised to see it work the other day.
|
# ¿ Oct 23, 2018 21:20 |
|
anthonypants posted:CentOS (and Fedora) are kind of upstream of RHEL, so I'm gonna say almost exactly as long as RHEL I'm pretty sure that's not the case, there have been a bunch of projects designed to provide security errata for centos. https://petersouter.xyz/the-story-of-errata-for-centos/
|
# ¿ Oct 24, 2018 06:01 |
|
I'm not sure if this is the right thread for this (hopefully it is) but I am trying to write a sed one liner to find a string which is wrapped in curly braces, and then once its found that string, expand the selection to the leading and trailing curly braces, and then delete everything. An example of the file I'm working with looks like this: code:
code:
code:
Can anyone help me write a sed command that makes sense for this or guide me in a better direction? I'm also using double quotes in the line above because I will eventually want to pass a variable to the command. I've checked with a couple PCRE regex validators online and my regex seems correct, so I thought that sed -r would be sufficient to parse it, but it seems like I might be miles off trying to just use sed, even running code:
post hole digger fucked around with this message at 01:39 on Nov 2, 2018 |
# ¿ Nov 2, 2018 01:37 |
|
Ryaath posted:Allow me to introduce you to our Lord and savior, jq Thanks, I'll check this out. Methanar posted:Is there any particular reason you're treating this as a regular string and not the structured data that it is? No, no reason at all. When I started working on this, I did briefly look at jq, but I don't have a ton of experience with JSON and I wasn't sure if something like that would work because of the => symbols. I also wasn't sure if that data actually was in JSON format because of the => symbols. Also, there are some strings at the beginning of this file, and I thought that might affect how the file was read. So I thought sed would be easiest, and then started having the issues which led me to post. Basically just didn't know any better. As for what I am doing, I am just trying to automate a workflow for myself. I am working on something that requires me to run a few bash commands, then I need to edit this file to delete a reference to the package (the part from my original post), and then run a few more commands that read that file once the string (data object?) has been removed. Docjowles posted:Use jq, or a json parsing lib in your favorite language that isn’t Bash. You can do this super easily in Python or Ruby or whatever. It doesn't have to be in bash. I was actually looking at Ruby potentially being easier to work with, I have a little experience with that and it looks like its just a couple of lines of Ruby. The only reason I was doing it in bash is this is one step out of a dozen or so, and the other steps are just bash commands. I started writing a shell script that was just the bash commands I needed to run, then I realized I forgot this step, and went back and tried to work it in with sed, which seemed like the most sensible tool to use at the time. post hole digger fucked around with this message at 06:40 on Nov 2, 2018 |
# ¿ Nov 2, 2018 06:38 |
|
|
# ¿ Apr 27, 2024 01:51 |
|
Since the file I have to work with is not quite standard JSON and contains a few oddities (commented out blocks, => symbols, variables defined at the top of the file), I didn't want to spend too much more time trying to get jq to play nice with it, and I've gone the hacky ruby route. Here is what I ended up with if anyone cares. After I added some parenthesis around the regex, it works for my needs.code:
post hole digger fucked around with this message at 19:34 on Nov 2, 2018 |
# ¿ Nov 2, 2018 19:31 |