teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

4

修正

2019/08/25 17:06

投稿

gants
gants

スコア18

title CHANGED
@@ -1,1 +1,1 @@
1
- azureにおいてansibleでvm作成時にエラーが出てしまいます。
1
+ azureにおいてvm作成時にエラーが出てしまいます。
body CHANGED
@@ -1,48 +1,8 @@
1
1
  教えてください。
2
- 以下のサイトを参考にansibleにてvm作成しようとしましたが、エラーが出てしまいます。
2
+
3
3
  どのように処理したらよいのかご教授お願いします。
4
4
 
5
- [リンク内容](https://docs.microsoft.com/ja-jp/azure/virtual-machines/linux/ansible-create-vm)
6
-
7
- VM作成しようとしましたが、エラーが生じたため、ひとつずつ原因を探っていました。
8
- すると、storage accountを作成するところで詰まった為、ここの部分のみで
9
- playbookを回しました。
10
-
11
- ```ここに言語を入力
12
- ---
13
- - hosts: localhost
14
- # connection: local
15
- tasks:
16
- - name: Create storage account
17
- azure_rm_storageaccount:
18
- name: testaccount255
19
- location: japaneast
20
- resource_group: myResourceGroup
21
- type: Standard_GRS
22
- state: present
23
- kind: StorageV2
24
- ```
25
-
26
-
27
- ```ここに言語を入力
28
- An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: __init__() takes exactly 1 argument (2 given)
29
- 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}
30
- ```
31
-
32
- tracebackしたところ、以下のようなエラーが出ました。
33
- ```ここに言語を入力
34
- The full traceback is:
35
- Traceback (most recent call last):
36
- File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 113, in <module>
37
- _ansiballz_main()
38
- File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 105, in _ansiballz_main
39
- invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
40
- File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 48, in invoke_module
41
- imp.load_module('__main__', mod, module, MOD_DESC)
42
- File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 460, in <module>
43
- File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 456, in main
44
- File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 198, in __init__
45
- 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__
5
+ "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/ansible_azure_rm_storageaccount_payload.zip/ansible/module_utils/azure_rm_common.py", line 308, in __init__
46
6
  File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 234, in exec_module
47
7
  File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 406, in create_account
48
8
  TypeError: __init__() takes exactly 1 argument (2 given)

3

リンク編集

2019/08/25 17:06

投稿

gants
gants

スコア18

title CHANGED
File without changes
body CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [リンク内容](https://docs.microsoft.com/ja-jp/azure/virtual-machines/linux/ansible-create-vm)
6
6
 
7
- VM作成えdエラーが生じたため、ひとつずつ原因を探っていました。
7
+ VM作成しようとしましたが、エラーが生じたため、ひとつずつ原因を探っていました。
8
8
  すると、storage accountを作成するところで詰まった為、ここの部分のみで
9
9
  playbookを回しました。
10
10
 

2

リンク編集

2019/08/17 15:59

投稿

gants
gants

スコア18

title CHANGED
File without changes
body CHANGED
@@ -4,9 +4,47 @@
4
4
 
5
5
  [リンク内容](https://docs.microsoft.com/ja-jp/azure/virtual-machines/linux/ansible-create-vm)
6
6
 
7
+ VM作成えdエラーが生じたため、ひとつずつ原因を探っていました。
8
+ すると、storage accountを作成するところで詰まった為、ここの部分のみで
9
+ playbookを回しました。
7
10
 
11
+ ```ここに言語を入力
12
+ ---
13
+ - hosts: localhost
14
+ # connection: local
15
+ tasks:
16
+ - name: Create storage account
17
+ azure_rm_storageaccount:
18
+ name: testaccount255
19
+ location: japaneast
20
+ resource_group: myResourceGroup
21
+ type: Standard_GRS
22
+ state: present
23
+ kind: StorageV2
24
+ ```
8
25
 
26
+
9
27
  ```ここに言語を入力
10
28
  An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: __init__() takes exactly 1 argument (2 given)
11
29
  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}
30
+ ```
31
+
32
+ tracebackしたところ、以下のようなエラーが出ました。
33
+ ```ここに言語を入力
34
+ The full traceback is:
35
+ Traceback (most recent call last):
36
+ File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 113, in <module>
37
+ _ansiballz_main()
38
+ File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 105, in _ansiballz_main
39
+ invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
40
+ File "/home/centos/.ansible/tmp/ansible-tmp-1566057135.18-169484224829729/AnsiballZ_azure_rm_storageaccount.py", line 48, in invoke_module
41
+ imp.load_module('__main__', mod, module, MOD_DESC)
42
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 460, in <module>
43
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 456, in main
44
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 198, in __init__
45
+ 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__
46
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 234, in exec_module
47
+ File "/tmp/ansible_azure_rm_storageaccount_payload_Bbjswy/__main__.py", line 406, in create_account
48
+ TypeError: __init__() takes exactly 1 argument (2 given)
49
+
12
50
  ```

1

リンク編集

2019/08/17 15:59

投稿

gants
gants

スコア18

title CHANGED
File without changes
body CHANGED
@@ -4,89 +4,7 @@
4
4
 
5
5
  [リンク内容](https://docs.microsoft.com/ja-jp/azure/virtual-machines/linux/ansible-create-vm)
6
6
 
7
- ```ここに言語を入力
8
- ---
9
- - name: Create Azure VM
10
- hosts: localhost
11
- connection: local
12
- tasks:
13
- - name: Create resource group
14
- azure_rm_resourcegroup:
15
- name: myResourceGroup
16
- location: japaneast
17
- - name: Create virtual network
18
- azure_rm_virtualnetwork:
19
- resource_group: myResourceGroup
20
- name: myVnet
21
- address_prefixes: "10.0.0.0/16"
22
- - name: Add subnet
23
- azure_rm_subnet:
24
- resource_group: myResourceGroup
25
- name: mySubnet
26
- address_prefix: "10.0.1.0/24"
27
- virtual_network: myVnet
28
- - name: Create public IP address
29
- azure_rm_publicipaddress:
30
- resource_group: myResourceGroup
31
- allocation_method: Static
32
- name: myPublicIP
33
- register: output_ip_address
34
- - name: Dump public IP for VM which will be created
35
- debug:
36
- msg: "The public IP is {{ output_ip_address.state.ip_address }}."
37
7
 
38
- - name: Create Network Security Group that allows PORT
39
- azure_rm_securitygroup:
40
- resource_group: myResourceGroup
41
- name: myNetworkSecurityGroup
42
- rules:
43
- - name: SSH
44
- protocol: Tcp
45
- destination_port_range: 22
46
- access: Allow
47
- priority: 1001
48
- direction: Inbound
49
- - name: HTTP
50
- protocol: Tcp
51
- destination_port_range: 80
52
- access: Allow
53
- priority: 2001
54
- direction: Inbound
55
- - name: HTTPS
56
- protocol: Tcp
57
- destination_port_range: 443
58
- access: Allow
59
- priority: 3001
60
- direction: Inbound
61
- - name: RDP
62
- protocol: Tcp
63
- destination_port_range: 3389
64
- access: Allow
65
- priority: 4001
66
- direction: Inbound
67
- - name: Create VM
68
- azure_rm_virtualmachine:
69
- resource_group: myResourceGroup
70
- name: s1
71
- vm_size: Standard_DS1_v2
72
- admin_username: s1
73
- location: japaneast
74
- # computerName: s1
75
- admin_password: Yama0530yama
76
- network_interfaces: myNIC
77
- image:
78
- sku: 2016-Datacenter
79
- publisher: MicrosoftWindowsServer
80
- version: latest
81
- offer: WindowsServer
82
- data_disks:
83
- os_disk_caching: 'ReadWrite'
84
- os_disk_size_gb: 128
85
- # managedDisk:
86
- managed_disk_type: 'Standard_LRS'
87
- name: myVMosdisk
88
- # createOption: FromImage
89
- ```
90
8
 
91
9
  ```ここに言語を入力
92
10
  An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: __init__() takes exactly 1 argument (2 given)