Cloud amazon and azure (#3610)

* Native YAML - cloud/amazon

* Native YAML - cloud/azure
This commit is contained in:
Fabio Alessandro Locati 2016-12-01 16:39:21 +00:00 committed by Matt Clay
parent 06a8f1d79b
commit 1e9333f822
5 changed files with 21 additions and 16 deletions

View file

@ -68,7 +68,8 @@ EXAMPLES = '''
stack_name: my-cloudformation-stack stack_name: my-cloudformation-stack
# Facts are published in ansible_facts['cloudformation'][<stack_name>] # Facts are published in ansible_facts['cloudformation'][<stack_name>]
- debug: msg={{ ansible_facts['cloudformation']['my-cloudformation-stack'] }} - debug:
msg: '{{ ansible_facts['cloudformation']['my-cloudformation-stack'] }}'
# Get all stack information about a stack # Get all stack information about a stack
- cloudformation_facts: - cloudformation_facts:

View file

@ -108,7 +108,9 @@ EXAMPLES = '''
register: response register: response
# the response will have a `logs` key that will contain a log (up to 4KB) of the function execution in Lambda. # the response will have a `logs` key that will contain a log (up to 4KB) of the function execution in Lambda.
- execute_lambda: name=test-function version_qualifier=PRODUCTION - execute_lambda:
name: test-function
version_qualifier: PRODUCTION
''' '''
RETURN = ''' RETURN = '''

View file

@ -95,7 +95,8 @@ EXAMPLES = '''
role: "arn:aws:iam::{{ account }}:role/API2LambdaExecRole" role: "arn:aws:iam::{{ account }}:role/API2LambdaExecRole"
- name: show results - name: show results
debug: var=lambda_facts debug:
var: lambda_facts
# The following will set the Dev alias to the latest version ($LATEST) since version is omitted (or = 0) # The following will set the Dev alias to the latest version ($LATEST) since version is omitted (or = 0)
- name: "alias 'Dev' for function {{ lambda_facts.FunctionName }} " - name: "alias 'Dev' for function {{ lambda_facts.FunctionName }} "

View file

@ -82,7 +82,8 @@ EXAMPLES = '''
query: all query: all
max_items: 20 max_items: 20
- name: show Lambda facts - name: show Lambda facts
debug: var=lambda_facts debug:
var: lambda_facts
''' '''
RETURN = ''' RETURN = '''

View file

@ -158,14 +158,19 @@ EXAMPLES = '''
register: azure register: azure
- name: Add new instance to host group - name: Add new instance to host group
add_host: hostname={{ item['ips'][0].public_ip }} groupname=azure_vms add_host:
hostname: '{{ item['ips'][0].public_ip }}'
groupname: azure_vms
with_items: "{{ azure.deployment.instances }}" with_items: "{{ azure.deployment.instances }}"
- hosts: azure_vms - hosts: azure_vms
user: devopscle user: devopscle
tasks: tasks:
- name: Wait for SSH to come up - name: Wait for SSH to come up
wait_for: port=22 timeout=2000 state=started wait_for:
port: 22
timeout: 2000
state: started
- name: echo the hostname of the vm - name: echo the hostname of the vm
shell: hostname shell: hostname
@ -243,15 +248,13 @@ EXAMPLES = '''
vnetID: "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]" vnetID: "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]"
subnetRef: "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]" subnetRef: "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]"
resources: resources:
- - type: "Microsoft.Storage/storageAccounts"
type: "Microsoft.Storage/storageAccounts"
name: "[parameters('newStorageAccountName')]" name: "[parameters('newStorageAccountName')]"
apiVersion: "2015-05-01-preview" apiVersion: "2015-05-01-preview"
location: "[variables('location')]" location: "[variables('location')]"
properties: properties:
accountType: "[variables('storageAccountType')]" accountType: "[variables('storageAccountType')]"
- - apiVersion: "2015-05-01-preview"
apiVersion: "2015-05-01-preview"
type: "Microsoft.Network/publicIPAddresses" type: "Microsoft.Network/publicIPAddresses"
name: "[variables('publicIPAddressName')]" name: "[variables('publicIPAddressName')]"
location: "[variables('location')]" location: "[variables('location')]"
@ -259,8 +262,7 @@ EXAMPLES = '''
publicIPAllocationMethod: "[variables('publicIPAddressType')]" publicIPAllocationMethod: "[variables('publicIPAddressType')]"
dnsSettings: dnsSettings:
domainNameLabel: "[parameters('dnsNameForPublicIP')]" domainNameLabel: "[parameters('dnsNameForPublicIP')]"
- - type: "Microsoft.Network/virtualNetworks"
type: "Microsoft.Network/virtualNetworks"
apiVersion: "2015-05-01-preview" apiVersion: "2015-05-01-preview"
name: "[variables('virtualNetworkName')]" name: "[variables('virtualNetworkName')]"
location: "[variables('location')]" location: "[variables('location')]"
@ -273,8 +275,7 @@ EXAMPLES = '''
name: "[variables('subnetName')]" name: "[variables('subnetName')]"
properties: properties:
addressPrefix: "[variables('subnetPrefix')]" addressPrefix: "[variables('subnetPrefix')]"
- - type: "Microsoft.Network/networkInterfaces"
type: "Microsoft.Network/networkInterfaces"
apiVersion: "2015-05-01-preview" apiVersion: "2015-05-01-preview"
name: "[variables('nicName')]" name: "[variables('nicName')]"
location: "[variables('location')]" location: "[variables('location')]"
@ -291,8 +292,7 @@ EXAMPLES = '''
id: "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" id: "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
subnet: subnet:
id: "[variables('subnetRef')]" id: "[variables('subnetRef')]"
- - type: "Microsoft.Compute/virtualMachines"
type: "Microsoft.Compute/virtualMachines"
apiVersion: "2015-06-15" apiVersion: "2015-06-15"
name: "[variables('vmName')]" name: "[variables('vmName')]"
location: "[variables('location')]" location: "[variables('location')]"