Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan...
Transcript of Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan...
![Page 1: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/1.jpg)
Going Serverless with AnsibleRyan Scott Brown - @ryan_sbSenior Software Engineer
![Page 2: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/2.jpg)
AboutBlogs @ Serverless CodeCommunity @ The Serverless ZoneWorks @ Ansible by Red Hat
Tweets @ryan_sb
2
![Page 3: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/3.jpg)
• Ansible Philosophy• Ansible for Cloud Resources• Playing Well w/ Other Tools• Mixing Infrastructures• State of the (Serverless) Union
Agenda
3
![Page 4: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/4.jpg)
Simple Wins
• Extend automation beyond the operations team• Works on two levels of abstraction
– Configuration management and provisioning– Orchestration and control-plane
• Bring existing tools and infrastructure
Ansible Philosophy
4
![Page 5: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/5.jpg)
Agentless
• Windows and Linux• Third-party APIs• Networking Hardware• Security mitigation
Ansible Philosophy
5
![Page 6: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/6.jpg)
• AWS• Azure• Google Cloud• OpenStack
Ansible for Cloud Resources
6
![Page 7: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/7.jpg)
Dynamic Inventory
• Resources are becoming more ephemeral• Cloud provider API is now the source of truth
Ansible for Cloud Resources
7
![Page 8: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/8.jpg)
Orchestrating Other Tools
- puppet: environment: production facts: serve_with: ssl application_version: v1.49.2
Ansible & Puppet
8
![Page 9: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/9.jpg)
Implementation Patterns
9
![Page 10: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/10.jpg)
Pattern 1Ansible and Serverless Framework
10
![Page 11: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/11.jpg)
Best of Both Worlds
• Helps to have devs with Serverless Framework experience• Can pass control for shared resources up to Ansible
Ansible & Serverless
11
![Page 12: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/12.jpg)
Sample Play
- cloudformation: stack_name: prod-vpc state: present template: base_vpc.yml- cloudformation_facts: stack_name: external_stack
Ansible & Serverless
12
![Page 13: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/13.jpg)
Inside base_vpc.yaml
Outputs: VpcId: Value: !Ref AppVPC Export: {Name: !Sub “${Stage}-VPCID”} SubnetA: Value: !Ref SubnetA Export: {Name: !Sub “${Stage}-VPCSubnetA”} SubnetB: Value: !Ref SubnetB Export:{Name: !Sub “${Stage}-VPCSubnetB”}
Ansible & Serverless
13
![Page 14: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/14.jpg)
- cloudformation: stack_name: prod-vpc state: present template_args: Stage: prod region: us-east-1 template: base_vpc.yml- serverless_deploy: stage: prod functions: - createUser - deleteUser region: us-east-1
Ansible & Serverless
14
![Page 15: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/15.jpg)
Migration Tips
• Attention to detail - who owns resources needed by both?• Make sure data is close enough to new & old systems• Don’t couple serverless & legacy too tightly• Remember Ansible can populate Serverless variable files
Ansible & Serverless
15
![Page 16: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/16.jpg)
Pattern 2Ansible All-In
16
![Page 17: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/17.jpg)
Fastest Start
• Ansible skills 100% transferrable• Add to existing playbooks• Great for “Lambda Light” workloads
Ansible Only
17
![Page 18: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/18.jpg)
Build a Function
- lambda: name: sendReportMail zip_file: "{{ deployment_package }}" runtime: python2.7 timeout: 20 handler: handler.handler memory_size: 1024 role: "{{ iam_exec_role }}" register: lambda
Ansible Only
18
![Page 19: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/19.jpg)
Cron Scheduling
- cloudwatchevent_rule: description: "Send out incident summary daily" name: incident_summary_schedule schedule_expression: 'rate(1 day)' targets: - id: SendSummary arn: "{{ lambda.configuration.function_arn }}" input: '{}’
Ansible Only
19
![Page 20: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/20.jpg)
Least Mature
• Limited event source availability– Kinesis/DynamoDB streams– CloudWatch Events
• No direct API Gateway (in v2.2)
Ansible Only
20
![Page 21: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/21.jpg)
State of the UnionSo, how’s Jeff?
21
![Page 22: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/22.jpg)
• Look for more integrations in 2.3• Serverless Framework module • Old & new apps can share tooling
State of the Union
22
![Page 23: Senior Software Engineer Ryan Scott Brown - Serverless Code · Going Serverless with Ansible Ryan Scott Brown - @ryan_sb Senior Software Engineer. About Blogs @ Serverless Code Community](https://reader030.fdocuments.in/reader030/viewer/2022041016/5ec8040d43fef409d772d71b/html5/thumbnails/23.jpg)
Thank You!Questions to @ryan_sb or find me at the social tonight
23