Skip to content

Instantly share code, notes, and snippets.

@devinnasar
devinnasar / freshclam comment
Created February 27, 2018 21:37
This fails when the string actually isn't in the file
freshclam_confirm_sysconfig_exists:
file.exists:
- name: {{ freshclam.sysconfig_path }}/freshclam
freshclam_enable_cron_script:
file.comment:
- name: {{ freshclam.sysconfig_path }}/freshclam
- regex: 'FRESHCLAM_DELAY=disabled-warn'
- char: '#'
- require:
# Gets the most recent directory under an s3 path
aws s3 ls "${_s3socpath}/tc-east-10/" | # list contents of s3 path
grep "PRE" | # filter for PRE (prefix) entries
awk '{printf $2"\n"}' | # print the second column of output (remove the PRE column)
sed 's/\/$//' | # cut the trailing slash off of paths
sort -r -n -t"-" -k1 -k2 -k3 | # sort the output: reverse, with a delimiter of hyphen ('-'), by the year, then month, then date
sed -n 1p # return the first line of output only
@devinnasar
devinnasar / mySrcDiff.diff
Created June 21, 2017 01:50
can I get diff to not place the timestamp in these files?
diff -ur '--exclude=3502_03' 2017-05-23/3301_03/workstation_patch_status 2017-06-02/3301_03/workstation_patch_status
--- 2017-05-23/3301_03/workstation_patch_status 2017-05-23 00:07:57.000000000 -0400 <-- this last part
+++ 2017-06-02/3301_03/workstation_patch_status 2017-06-02 11:55:10.000000000 -0400
@@ -23,7 +23,7 @@
...
# State
# Blacklist
ipset_set_blacklist_exists:
ipset.set_present:
- name: blacklist
- set_type: hash:ip
- hashsize: 4096
- family: ipv4
- comment: blackist
@devinnasar
devinnasar / gist:3948416b9657ba4d3715ea8c9f5ce156
Created May 26, 2017 15:53
What's going on here? It ran the first state then said it couldn't find the second state
ID: clamd_config
Function: file.managed
Name: /etc/clamd.d/scan.conf
Result: True
Comment: File /etc/clamd.d/scan.conf updated
Started: 15:50:58.259184
Duration: 168.688 ms
Changes:
----------
diff:
@devinnasar
devinnasar / gist:5ce84967251d5c08465d52cc56e486ca
Created May 24, 2017 19:27
salt-cloud doesn't like my profile...
# provider
aws-ec2-east:
driver: ec2
id: <obfuscated>
key: <obfuscated>
keyname: salt-e
minion:
master: <obfuscated>
private_key: /root/.ssh/salt-e.pem
ssh_interface: private_ips
[root@OTCMVM0000 master.d]# salt-run git_pillar.update -l trace
[DEBUG ] Missing configuration file: /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/engine.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/engine.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/f_defaults.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/f_defaults.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/lxc_profiles.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/lxc_profiles.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/reactor.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/reactor.conf
[root@OTCMVM0000 master.d]# salt-run git_pillar.uplate -l trace
[DEBUG ] Missing configuration file: /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/engine.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/engine.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/f_defaults.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/f_defaults.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/lxc_profiles.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/lxc_profiles.conf
[DEBUG ] Including configuration from '/etc/salt/master.d/reactor.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/reactor.conf
# Remote pillar information
2017-05-23 18:08:19,546 [salt.utils.gitfs ][DEBUG ][11994] Fetching git_pillar remote 'master git@bitbucket.org:opentempo/salt-pillar.git'
2017-05-23 18:08:19,747 [salt.utils.gitfs ][DEBUG ][11994] git_pillar remote 'master git@bitbucket.org:opentempo/salt-pillar.git' is up-to-date
2017-05-23 18:08:19,748 [salt.utils.gitfs ][DEBUG ][11994] pygit2 does not support detecting stale refs for authenticated remotes, saltenvs will not reflect branches/tags removed from remote 'master git@bitbucket.org:opentempo/salt-pillar.git'
2017-05-23 18:08:19,748 [salt.utils.gitfs ][DEBUG ][11994] Removed update lock for git_pillar remote 'master git@bitbucket.org:opentempo/salt-pillar.git'
# Attempted highstate.
[root@OTCMVM0000 master.d]# salt -G 'role_code:CM' state.apply highstate
[DEBUG ] Configuration file path: /etc/salt/master
[WARNING ] In
pygit-deps: # State
pkg.group_installed:
- name: Development Tools
pkg.installed:
- pkgs:
- cmake
- gcc
- http-parser-devel