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
import subprocess | |
def lambda_handler(event, context): | |
print( | |
subprocess.check_output( | |
'whereis ssh', | |
shell=True | |
) | |
) |
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
import sys | |
def lambda_handler(event, context): | |
print( | |
' '.join(sys.modules.keys()) | |
) | |
# heapq code functools random wsgi sysconfig logging.os | |
# encodings.encodings logging.weakref tempfile base64 | |
# _json imp collections logging.thread wsgiref.os zipimport |
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/python | |
import ansible.inventory | |
import ansible.playbook | |
import ansible.runner | |
from ansible import utils | |
from ansible import callbacks | |
def run_playbook(**kwargs): |
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
- hosts: all | |
connection: local | |
tasks: | |
- shell: echo test |
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/python | |
import ansible.inventory | |
import ansible.playbook | |
import ansible.runner | |
import ansible.constants | |
from ansible import utils | |
from ansible import callbacks | |
def run_playbook(**kwargs): |
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
import json | |
import boto3 | |
def lambda_handler(event, context): | |
client = boto3.client('sns', region_name='us-west-2') | |
response = client.publish( | |
TopicArn='arn:aws:sns:us-west-2:XXXXXXX:ansible-api', | |
Message=json.dumps(event), |
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
{ | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], | |
"Resource": "arn:aws:logs:*:*:*" |
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/python | |
import json | |
import ansible.inventory | |
import ansible.playbook | |
import ansible.runner | |
import ansible.constants | |
from ansible import utils | |
from ansible import callbacks | |
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
- hosts: localhost | |
become: yes | |
connection: local | |
tasks: | |
- apt_key: | |
keyserver: keyserver.ubuntu.com | |
id: 642AC823 | |
- apt_repository: |
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
- hosts: localhost | |
become: yes | |
connection: local | |
tasks: | |
- apt_key: | |
keyserver: keyserver.ubuntu.com | |
id: 642AC823 | |
- apt_repository: |