This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "SOURCE.source1": { | |
| "EventReceivedCount": "5025440", | |
| "AppendBatchAcceptedCount": "5025440", | |
| "Type": "SOURCE", | |
| "EventAcceptedCount": "5025440", | |
| "AppendReceivedCount": "0", | |
| "StartTime": "1438294878631", | |
| "OpenConnectionCount": "0", | |
| "AppendAcceptedCount": "0", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import subprocess | |
| def get_ipmi_ip(): | |
| grains = {} | |
| grains['ipmi_ip'] = True | |
| ipmiIpString = ('/usr/bin/ipmitool', 'lan', 'print', '1') #This will print out the full ipmitool lan print, not just the IP unfortunately | |
| #['/usr/bin/ipmitool', 'lan', 'print', '|', 'awk', '"/IP Address /', '{ print $4 }"'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'This grain is to retrieve the drive list from /proc/scsi/scsi' | |
| import subprocess | |
| def get_drives(): | |
| grains = {} | |
| grains['drive_list'] = True | |
| execString = ('grep', '-E', '\"TOSHIBA|SEAGATE|ATA|HGST\"', '/proc/scsi/scsi') | |
| process = subprocess.call((execString), stdout=STDOUT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'This grain is to retrieve the drive list from /proc/scsi/scsi' | |
| import subprocess | |
| from subprocess import stdout | |
| def get_drives(): | |
| grains = {} | |
| grains['drive_list'] = True | |
| execString = ('grep', '-E', '\"TOSHIBA|SEAGATE|ATA|HGST\"', '/proc/scsi/scsi') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'Akhter Ali' | |
| __date__ = '08/12/15' | |
| __version__ = '0.1.0' | |
| try: | |
| import salt.cloud | |
| CLOUDIMPORTED = True | |
| print('salt.cloud successfully imported') | |
| except ImportError: | |
| CLOUDIMPORTED = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| akhterpod01.dev.aws.resonatedigital.net: | |
| The minion function caused an exception: Traceback (most recent call last): | |
| File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1020, in _thread_return | |
| return_data = func(*args, **kwargs) | |
| File "/var/cache/salt/minion/extmods/modules/checkhighstate_test.py", line 37, in destroy | |
| client.destroy(names=[minion_name]) | |
| File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 361, in destroy | |
| mapper.destroy(names) | |
| File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1064, in destroy | |
| ', '.join(names) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'Akhter Ali' | |
| __date__ = '08/12/15' | |
| __version__ = '0.1.0' | |
| try: | |
| import salt.cloud | |
| CLOUDIMPORTED = True | |
| print('salt.cloud successfully imported') | |
| except ImportError: | |
| CLOUDIMPORTED = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [DEV [email protected] salt-master]# docker run -itd salt-master:latest /bin/bash | |
| bbf3d9b9aa7ab2248cbdc7c1a6d56798d3075f9df449e3941e7f97244b002371 | |
| [DEV [email protected] salt-master]# docker ps | |
| CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
| bbf3d9b9aa7a salt-master:latest "/bin/bash" 8 seconds ago Up 7 seconds dreamy_banach | |
| 9c8da598d4bd salt-master:latest "/bin/sh -c salt-mast" About a minute ago Up About a minute salt4 | |
| da8f6540f936 salt-master "/bin/sh -c salt-mast" 2 minutes ago Up 2 minutes salt3 | |
| 4b311c57b7c8 salt-master "/bin/sh -c salt-mast" 3 minutes ago Up 3 minutes salt2 | |
| c3f6286f076c salt-master "/bin/sh -c salt-mast" 14 minutes ago Up 14 minutes salt | |
| ec97c3fcdf1e salt-mi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from boto3 import Session | |
| from boto3 import client | |
| import urllib | |
| instance_id = urllib.urlopen('http://169.254.169.254/latest/meta-data/instance-id/').read() | |
| def Register_To_ELB(*args): | |
| print('my arg {0}'.format(args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% for args in pillar.get('service_accounts:teamcity', {}).items() %} | |
| {{ args['user'] }}: | |
| user.present: | |
| - home: {{ args['home'] }} | |
| - shell: {{ args['shell'] }} | |
| - uid: {{ args['uid'] }} | |
| - groups: {{ args['groups'] }} | |
| - fullname: {{ args['fullname'] }} | |
| ssh_auth.present: | |
| - user: {{ args['user'] }} |