ansible - Ansible 任务错误:{“msg”:“目标目录 /opt/connectdirect/ndm/cfg/CD.STK 不存在”}
问题描述
我正在修改 ansible 任务以在 EC2 实例中直接安装 IBM connect。但是,它在下一阶段失败了
# Add config files
- block:
- name: Add netmap.cfg
template:
src: "cfg/netmap.cfg"
dest: "{{ install_dir }}/ndm/cfg/{{ node_name }}/netmap.cfg"
- name: Add userfile.cfg
template:
src: "cfg/userfile.cfg"
dest: "{{ install_dir }}/ndm/cfg/{{ node_name }}/userfile.cfg"
Note: value of install_dir in variable file
# Target location of the install, owned by `cd_user_name`
install_dir: '/opt/connectdirect'
# The node name of this box. This must be shared with the team.
node_name: CD.STK
# The user name running C:D. This must be shared with the team.
cd_user_name: abc
错误
TASK [connect-direct : Add netmap.cfg] ************************************************************************************************************
fatal: [10.245.124.252]: FAILED! => {"changed": false, "checksum": "e369f94df4be277b71a62946a899e0246362ea4c", "msg": "Destination directory /opt/connectdirect/ndm/cfg/CD.STK does not exist"}
我做了什么来验证
我 sshed 进入 EC2 实例并转到/opt/connectdirect/ndm/cfg/
路径,发现它CD.STK
不存在,因此错误在那里。
我不确定
由于我从未安装过用于文件传输的 connect_direct 软件实用程序,因此我不确定是否应该在安装过程中创建CD.STK (value of node_name variable)
目录。/opt/connectdirect/ndm/cfg/
当我检查代码时,我看到它有以下部分{{ node_name }}
在安装任务期间被传递
- name: Run the Connect:Direct installer
expect:
echo: yes
chdir: "{{ install_work_dir }}"
command: "./cdinstall"
timeout: 300
responses:
#there's other responses before/after below-mentioned responses here which I've not posted
# here to keep the post as small as possible. Fyi, Installation task ran successfully.
# Choose node name
(.*)Please enter name of Connect:Direct node you want to customize(.*): "{{ node_name }}"
# Configure server network settings
(.*)Enter TCP\/IP port to listen for a remote connection request:\[1234\](.*): "\n"
(.*)Enter TCP\/IP hostname to listen for a remote connection request:\[0.0.0.0\](.*): "\n"
(.*)Enter TCP\/IP port to listen for a Client connection request:\[1233\](.*): "\n"
(.*)Enter TCP\/IP hostname to listen for a Client connection request:\[.+\](.*): "localhost\n"
你能建议我做什么吗?
我应该/opt/connectdirect/ndm/cfg/CD.STK
使用单独的任务创建然后*.cfg
在其中传输文件吗?我在这里询问是否可以使用单独的任务创建目录。由于我不确定但猜测应该在安装过程中创建了这个目录(或路径),所以我在这里要求查看它正在运行的创建任务CD.STK
不会破坏任何功能,因为其他一些团队将使用此信息(username/node name)
来传输数据.
解决方案
推荐阅读
- java - 如何使用国家名称获取区域名称(亚洲/卡拉奇)?
- mysql - 如何在 MYSQL 中为多表级搜索编写查询
- css - 如何使 ag-grid 中的单元格内容垂直居中?
- java - 为什么@PathVariable 会修剪包含# 的数据?
- rsa - 在 ESP32 上使用 RSA 加密消息
- microsoft-graph-api - 从 Microsoft Team Channel 中的本地系统将文件/图像作为消息发送
- c# - 检索文件并使其成为可点击的格式以在新窗口中打开或可下载
- amazon-web-services - 从 EC2 实例中删除自定义域,然后将域用于 Cloud Run 应用程序(Route 53 中的域)
- c# - 如何在 .NET 中创建带有脱机文件(类似于 OneDrive)的虚拟文件系统?
- python - 在 Python 中重构字典的层次结构