質問編集履歴

4

修正

2019/08/25 17:06

投稿

gants
gants

スコア18

test CHANGED
@@ -1 +1 @@
1
- azureにおいてansibleでvm作成時にエラーが出てしまいます。
1
+ azureにおいてvm作成時にエラーが出てしまいます。
test CHANGED
@@ -1,92 +1,12 @@
1
1
  教えてください。
2
2
 
3
- 以下のサイトを参考にansibleにてvm作成しようとしましたが、エラーが出てしまいます。
3
+
4
4
 
5
5
  どのように処理したらよいのかご教授お願いします。
6
6
 
7
7
 
8
8
 
9
- [リンク内容](https://docs.microsoft.com/ja-jp/azure/virtual-machines/linux/ansible-create-vm)
10
-
11
-
12
-
13
- VM作成しようとしましたが、エラーが生じたため、ひとつずつ原因を探っていました。
14
-
15
- すると、storage accountを作成するところで詰まった為、ここの部分のみで
16
-
17
- playbookを回しました。
18
-
19
-
20
-
21
- ```ここに言語を入力
22
-
23
- ---
24
-
25
- - hosts: localhost
26
-
27
- # connection: local
28
-
29
- tasks:
30
-
31
- - name: Create storage account
32
-
33
- azure_rm_storageaccount:
34
-
35
- name: testaccount255
36
-
37
- location: japaneast
38
-
39
- resource_group: myResourceGroup
40
-
41
- type: Standard_GRS
42
-
43
- state: present
44
-
45
- kind: StorageV2
46
-
47
- ```
48
-
49
-
50
-
51
-
52
-
53
- ```ここに言語を入力
54
-
55
- An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: __init__() takes exactly 1 argument (2 given)
56
-
57
- fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/centos/.ansible/tmp/ansible-tmp-1566040728.8-222470742507241/AnsiballZ_azure_rm_storageaccount.py\", line 113, in <module>\n _ansiballz_main()\n File \"/home/centos/.ansible/tmp/ansible-tmp-1566040728.8-222470742507241/AnsiballZ_azure_rm_storageaccount.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/centos/.ansible/tmp/ansible-tmp-1566040728.8-222470742507241/AnsiballZ_azure_rm_storageaccount.py\", line 48, in invoke_module\n imp.load_module('__main__', mod, module, MOD_DESC)\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 460, in <module>\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 456, in main\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 198, in __init__\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/ansible_azure_rm_storageaccount_payload.zip/ansible/module_utils/azure_rm_common.py\", line 308, in __init__\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 234, in exec_module\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 406, in create_account\nTypeError: __init__() takes exactly 1 argument (2 given)\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
58
-
59
- ```
60
-
61
-
62
-
63
- tracebackしたところ、以下のようなエラーが出ました。
64
-
65
- ```ここに言語を入力
66
-
67
- The full traceback is:
68
-
69
- Traceback (most recent call last):
70
-
71
- File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 113, in <module>
72
-
73
- _ansiballz_main()
74
-
75
- File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 105, in _ansiballz_main
76
-
77
- invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
78
-
79
- File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 48, in invoke_module
80
-
81
- imp.load_module('__main__', mod, module, MOD_DESC)
82
-
83
- File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 460, in <module>
84
-
85
- File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 456, in main
86
-
87
- File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 198, in __init__
88
-
89
- File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/ansible_azure_rm_storageaccount_payload.zip/ansible/module_utils/azure_rm_common.py", line 308, in __init__
9
+ "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/ansible_azure_rm_storageaccount_payload.zip/ansible/module_utils/azure_rm_common.py", line 308, in __init__
90
10
 
91
11
  File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 234, in exec_module
92
12
 

3

リンク編集

2019/08/25 17:06

投稿

gants
gants

スコア18

test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
 
12
12
 
13
- VM作成えdエラーが生じたため、ひとつずつ原因を探っていました。
13
+ VM作成しようとしましたが、エラーが生じたため、ひとつずつ原因を探っていました。
14
14
 
15
15
  すると、storage accountを作成するところで詰まった為、ここの部分のみで
16
16
 

2

リンク編集

2019/08/17 15:59

投稿

gants
gants

スコア18

test CHANGED
File without changes
test CHANGED
@@ -10,6 +10,42 @@
10
10
 
11
11
 
12
12
 
13
+ VM作成えdエラーが生じたため、ひとつずつ原因を探っていました。
14
+
15
+ すると、storage accountを作成するところで詰まった為、ここの部分のみで
16
+
17
+ playbookを回しました。
18
+
19
+
20
+
21
+ ```ここに言語を入力
22
+
23
+ ---
24
+
25
+ - hosts: localhost
26
+
27
+ # connection: local
28
+
29
+ tasks:
30
+
31
+ - name: Create storage account
32
+
33
+ azure_rm_storageaccount:
34
+
35
+ name: testaccount255
36
+
37
+ location: japaneast
38
+
39
+ resource_group: myResourceGroup
40
+
41
+ type: Standard_GRS
42
+
43
+ state: present
44
+
45
+ kind: StorageV2
46
+
47
+ ```
48
+
13
49
 
14
50
 
15
51
 
@@ -21,3 +57,43 @@
21
57
  fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/centos/.ansible/tmp/ansible-tmp-1566040728.8-222470742507241/AnsiballZ_azure_rm_storageaccount.py\", line 113, in <module>\n _ansiballz_main()\n File \"/home/centos/.ansible/tmp/ansible-tmp-1566040728.8-222470742507241/AnsiballZ_azure_rm_storageaccount.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/centos/.ansible/tmp/ansible-tmp-1566040728.8-222470742507241/AnsiballZ_azure_rm_storageaccount.py\", line 48, in invoke_module\n imp.load_module('__main__', mod, module, MOD_DESC)\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 460, in <module>\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 456, in main\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 198, in __init__\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/ansible_azure_rm_storageaccount_payload.zip/ansible/module_utils/azure_rm_common.py\", line 308, in __init__\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 234, in exec_module\n File \"/tmp/ansible_azure_rm_storageaccount_payload_TwfO5S/__main__.py\", line 406, in create_account\nTypeError: __init__() takes exactly 1 argument (2 given)\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
22
58
 
23
59
  ```
60
+
61
+
62
+
63
+ tracebackしたところ、以下のようなエラーが出ました。
64
+
65
+ ```ここに言語を入力
66
+
67
+ The full traceback is:
68
+
69
+ Traceback (most recent call last):
70
+
71
+ File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 113, in <module>
72
+
73
+ _ansiballz_main()
74
+
75
+ File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 105, in _ansiballz_main
76
+
77
+ invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
78
+
79
+ File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 48, in invoke_module
80
+
81
+ imp.load_module('__main__', mod, module, MOD_DESC)
82
+
83
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 460, in <module>
84
+
85
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 456, in main
86
+
87
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 198, in __init__
88
+
89
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/ansible_azure_rm_storageaccount_payload.zip/ansible/module_utils/azure_rm_common.py", line 308, in __init__
90
+
91
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 234, in exec_module
92
+
93
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 406, in create_account
94
+
95
+ TypeError: __init__() takes exactly 1 argument (2 given)
96
+
97
+
98
+
99
+ ```

1

リンク編集

2019/08/17 15:59

投稿

gants
gants

スコア18

test CHANGED
File without changes
test CHANGED
@@ -10,171 +10,7 @@
10
10
 
11
11
 
12
12
 
13
- ```ここに言語を入力
14
13
 
15
- ---
16
-
17
- - name: Create Azure VM
18
-
19
- hosts: localhost
20
-
21
- connection: local
22
-
23
- tasks:
24
-
25
- - name: Create resource group
26
-
27
- azure_rm_resourcegroup:
28
-
29
- name: myResourceGroup
30
-
31
- location: japaneast
32
-
33
- - name: Create virtual network
34
-
35
- azure_rm_virtualnetwork:
36
-
37
- resource_group: myResourceGroup
38
-
39
- name: myVnet
40
-
41
- address_prefixes: "10.0.0.0/16"
42
-
43
- - name: Add subnet
44
-
45
- azure_rm_subnet:
46
-
47
- resource_group: myResourceGroup
48
-
49
- name: mySubnet
50
-
51
- address_prefix: "10.0.1.0/24"
52
-
53
- virtual_network: myVnet
54
-
55
- - name: Create public IP address
56
-
57
- azure_rm_publicipaddress:
58
-
59
- resource_group: myResourceGroup
60
-
61
- allocation_method: Static
62
-
63
- name: myPublicIP
64
-
65
- register: output_ip_address
66
-
67
- - name: Dump public IP for VM which will be created
68
-
69
- debug:
70
-
71
- msg: "The public IP is {{ output_ip_address.state.ip_address }}."
72
-
73
-
74
-
75
- - name: Create Network Security Group that allows PORT
76
-
77
- azure_rm_securitygroup:
78
-
79
- resource_group: myResourceGroup
80
-
81
- name: myNetworkSecurityGroup
82
-
83
- rules:
84
-
85
- - name: SSH
86
-
87
- protocol: Tcp
88
-
89
- destination_port_range: 22
90
-
91
- access: Allow
92
-
93
- priority: 1001
94
-
95
- direction: Inbound
96
-
97
- - name: HTTP
98
-
99
- protocol: Tcp
100
-
101
- destination_port_range: 80
102
-
103
- access: Allow
104
-
105
- priority: 2001
106
-
107
- direction: Inbound
108
-
109
- - name: HTTPS
110
-
111
- protocol: Tcp
112
-
113
- destination_port_range: 443
114
-
115
- access: Allow
116
-
117
- priority: 3001
118
-
119
- direction: Inbound
120
-
121
- - name: RDP
122
-
123
- protocol: Tcp
124
-
125
- destination_port_range: 3389
126
-
127
- access: Allow
128
-
129
- priority: 4001
130
-
131
- direction: Inbound
132
-
133
- - name: Create VM
134
-
135
- azure_rm_virtualmachine:
136
-
137
- resource_group: myResourceGroup
138
-
139
- name: s1
140
-
141
- vm_size: Standard_DS1_v2
142
-
143
- admin_username: s1
144
-
145
- location: japaneast
146
-
147
- # computerName: s1
148
-
149
- admin_password: Yama0530yama
150
-
151
- network_interfaces: myNIC
152
-
153
- image:
154
-
155
- sku: 2016-Datacenter
156
-
157
- publisher: MicrosoftWindowsServer
158
-
159
- version: latest
160
-
161
- offer: WindowsServer
162
-
163
- data_disks:
164
-
165
- os_disk_caching: 'ReadWrite'
166
-
167
- os_disk_size_gb: 128
168
-
169
- # managedDisk:
170
-
171
- managed_disk_type: 'Standard_LRS'
172
-
173
- name: myVMosdisk
174
-
175
- # createOption: FromImage
176
-
177
- ```
178
14
 
179
15
 
180
16