45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
---
|
|
- name: get resource group info
|
|
become: true
|
|
become_user: root
|
|
# become_method: runas
|
|
hosts: localhost
|
|
roles:
|
|
- role: azure_createlinvm
|
|
tasks:
|
|
- name: make host group from survey hosts list
|
|
add_host:
|
|
hostname: "{{nic_info.networkinterfaces[0].ip_configurations[0].private_ip_address}}"
|
|
groups: new_group
|
|
ansible_connection: ssh
|
|
# become: true
|
|
become_method: sudo
|
|
ansible_user: ApeAdmin
|
|
ansible_ssh_pass: "{{password}}"
|
|
|
|
environment:
|
|
- AZURE_CLIENT_ID: 140ddce1-f5e1-45a3-84e0-38e8ec16e72b
|
|
- AZURE_SECRET: "{{secret}}"
|
|
- AZURE_SUBSCRIPTION_ID: a7f4215b-c8f8-45ac-8fdd-062c940b02f6
|
|
- AZURE_TENANT: 26845d4f-0cf4-4d08-b717-06b6b7824ec4
|
|
|
|
|
|
- name: ping vm
|
|
gather_facts: true
|
|
# become: false
|
|
hosts: new_group
|
|
tasks:
|
|
- name: ping vm
|
|
ansible.builtin.ping:
|
|
- name: Onboard vm
|
|
gather_facts: true
|
|
become: true
|
|
become_method: sudo
|
|
become_user: root
|
|
hosts: new_group
|
|
roles:
|
|
- role: linux_onboard-adagility
|
|
- role: linux_install-checkmk
|
|
- role: linux_install-sentinelone
|
|
|
|
|