Created
June 3, 2014 01:12
-
-
Save ryan-lane/45816ae22390b28c06aa to your computer and use it in GitHub Desktop.
This file contains 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
Ensure myelb exists: | |
boto_elb.present: | |
- name: myelb | |
- availability_zones: | |
- us-east-1a | |
- listeners: | |
- elb_port: 80 | |
instance_port: 8210 | |
elb_protocol: HTTP | |
- elb_port: 443 | |
instance_port: 8210 | |
elb_protocol: HTTPS | |
instance_protocol: HTTP | |
certificate: 'arn:aws:iam::879879:server-certificate/mycert' | |
- health_check: | |
target: 'TCP:8210' | |
- profile: myprofile | |
# Fetch the ELB information so that we can get the DNS info from it. | |
{% set elb = salt['boto_elb.get_elb_config']('myelb', profile='myprofile') %} | |
# Ensure we only modify DNS if we got info about the ELB | |
{% if elb %} | |
Ensure myrecord.example.com cname points at ELB: | |
boto_route53.present: | |
- name: myrecord.example.com. | |
- zone: example.com. | |
- type: CNAME | |
- value: {{ elb.dns_name }} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This of course doesn't work since jinja is rendered before the states. Sigh.