@@ -44,7 +44,7 @@ If you are onboarding machines to Azure Arc-enabled servers, copy the following
44
44
tasks :
45
45
- name: Check if the Connected Machine Agent has already been downloaded on Linux servers
46
46
stat:
47
- path: /usr/bin/azvmagent
47
+ path: /usr/bin/azcmagent
48
48
get_attributes: False
49
49
get_checksum: False
50
50
get_mine: azcmagent_downloaded
@@ -72,7 +72,8 @@ If you are onboarding machines to Azure Arc-enabled servers, copy the following
72
72
when : (ansible_os_family == 'Windows') and (not azcmagent_downloaded.stat.exists)
73
73
- name : Install the Connected Machine Agent on Linux servers
74
74
become : yes
75
- shell : bash ~/install_linux_azcmagent.sh
75
+ command :
76
+ cmd: bash ~/install_linux_azcmagent.sh
76
77
when : (ansible_system == 'Linux') and (not azcmagent_downloaded.stat.exists)
77
78
- name : Install the Connected Machine Agent on Windows servers
78
79
win_package :
@@ -81,11 +82,12 @@ If you are onboarding machines to Azure Arc-enabled servers, copy the following
81
82
- name: Check if the Connected Machine Agent has already been connected
82
83
become: true
83
84
command:
84
- cmd: azcmagent show --join
85
+ cmd: azcmagent show
85
86
register : azcmagent_connected
86
87
- name : Connect the Connected Machine Agent on Linux servers to Azure Arc
87
88
become : yes
88
- shell : sudo azcmagent connect --service-principal-id {{ azure.service_principal_id }} --service-principal-secret {{ azure.service_principal_secret }} --resource-group {{ azure.resource_group }} --tenant-id {{ azure.tenant_id }} --location {{ azure.location }} --subscription-id {{ azure.subscription_id }}
89
+ command :
90
+ cmd: azcmagent connect --service-principal-id {{ azure.service_principal_id }} --service-principal-secret {{ azure.service_principal_secret }} --resource-group {{ azure.resource_group }} --tenant-id {{ azure.tenant_id }} --location {{ azure.location }} --subscription-id {{ azure.subscription_id }}
89
91
when : (azcmagent_connected.rc == 0) and (ansible_system == 'Linux')
90
92
- name : Connect the Connected Machine Agent on Windows servers to Azure
91
93
win_shell : ' & $env:ProgramFiles\AzureConnectedMachineAgent\azcmagent.exe connect --service-principal-id "{{ azure.service_principal_id }}" --service-principal-secret "{{ azure.service_principal_secret }}" --resource-group "{{ azure.resource_group }}" --tenant-id "{{ azure.tenant_id }}" --location "{{ azure.location }}" --subscription-id "{{ azure.subscription_id }}"'
0 commit comments