質問編集履歴
5
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
|
4
4
|
### 前提・実現したいこと
|
5
5
|
|
6
|
-
|
6
|
+
WindowsserverにあるTeraTarmmacroをPowershellでバッチファイル化
|
7
|
+
そのPowershellをAnsibleから実行したい
|
7
8
|
|
8
9
|
### 発生している問題・エラーメッセージ
|
9
10
|
|
4
playbookの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -23,16 +23,19 @@
|
|
23
23
|
```
|
24
24
|
|
25
25
|
■インベントリファイル
|
26
|
+
```ここに言語を入力
|
26
27
|
[windows]
|
27
28
|
WindowsserverのIPアドレス
|
28
29
|
|
30
|
+
|
29
31
|
[windows:vars]
|
30
32
|
ansible_ssh_user=Administrator
|
31
|
-
ansible_ssh_pass=
|
33
|
+
ansible_ssh_pass=serverのPW
|
32
34
|
ansible_ssh_port=5986
|
33
35
|
ansible_connection=winrm
|
34
36
|
ansible_winrm_transport=basic
|
35
37
|
ansible_winrm_server_cert_validation=ignore
|
38
|
+
```
|
36
39
|
|
37
40
|
■実行結果
|
38
41
|
changed: [WindowsserverのIPアドレス] => {
|
3
playbookの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
|
13
13
|
### 該当のソースコード
|
14
14
|
■作成したplaybook
|
15
|
+
```ここに言語を入力
|
15
16
|
---
|
16
17
|
- hosts: windows
|
17
18
|
gather_facts: false
|
@@ -19,6 +20,7 @@
|
|
19
20
|
- name: Run shell command
|
20
21
|
tags: setting
|
21
22
|
win_shell: C:\tmp\script\restore.ps1
|
23
|
+
```
|
22
24
|
|
23
25
|
■インベントリファイル
|
24
26
|
[windows]
|
2
playbookの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,15 +12,13 @@
|
|
12
12
|
|
13
13
|
### 該当のソースコード
|
14
14
|
■作成したplaybook
|
15
|
-
|
15
|
+
---
|
16
|
-
|
16
|
+
- hosts: windows
|
17
|
-
|
17
|
+
gather_facts: false
|
18
|
-
|
18
|
+
tasks:
|
19
|
-
|
19
|
+
- name: Run shell command
|
20
|
-
|
20
|
+
tags: setting
|
21
|
-
|
21
|
+
win_shell: C:\tmp\script\restore.ps1
|
22
|
-
args:
|
23
|
-
excutable: cmd
|
24
22
|
|
25
23
|
■インベントリファイル
|
26
24
|
[windows]
|
1
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,13 +14,13 @@
|
|
14
14
|
■作成したplaybook
|
15
15
|
‐‐‐
|
16
16
|
‐ hosts: windows
|
17
|
-
gather_facts: false
|
17
|
+
gather_facts: false
|
18
|
-
tasks:
|
18
|
+
tasks:
|
19
|
-
‐ name: Run shell command
|
19
|
+
‐ name: Run shell command
|
20
|
-
tags: setting
|
20
|
+
tags: setting
|
21
|
-
win_shell: C:\tmp\script\restore.ps1
|
21
|
+
win_shell: C:\tmp\script\restore.ps1
|
22
|
-
args:
|
22
|
+
args:
|
23
|
-
excutable: cmd
|
23
|
+
excutable: cmd
|
24
24
|
|
25
25
|
■インベントリファイル
|
26
26
|
[windows]
|