ansible - 使用 Ansible-Playbook 接受 Splunk 许可协议
问题描述
我是使用 Ansible-Playbooks 的新手,在接受 Splunk 的许可协议时遇到了问题。
每当我运行 shell 时:
"/opt/splunkforwarder/bin/splunk start --accept-license --answer-yes"
我得到一个连续的锁定,迫使我终止程序。
TASK [acceptlicense] ****************************************************************************************************************
^C
进入盒子并手动运行命令,我被告知以下内容:
[root@##########-lab_env]# /opt/splunkforwarder/bin/splunk start --accept-license --answer-yes
This appears to be your first time running this version of Splunk.
Create credentials for the administrator account.
Characters do not appear on the screen when you type the password.
Password must contain at least:
* 8 total printable ASCII character(s).
Please enter a new password:
我已经浏览了几个在线论坛,可以帮助回答遇到这样的特定提示时该怎么做,但是每当我进行调整时,我都会被告知以下内容:
错误!“_______”不是任务的有效属性
在这一点上,我很困惑,不确定如何继续。
我的代码片段如下:
- hosts: "{{hostName}}"
become: true
become_user: root
become_method: sudo
tasks:
- name: copy_splunk
shell: cp splunkforwarder-7.1.3-51d9cac7b837-linux-2.6-x86_64.rpm /opt/.; date; ls -l /opt
args:
chdir: /tmp
register: run_ll
- debug: var=run_ll.stdout_lines
- name: install rpm package
shell: rpm -ivh splunkforwarder-7.1.3-51d9cac7b837-linux-2.6-x86_64.rpm
args:
chdir: /tmp
ignore_errors: True
register: install_rpm
- debug: var=install_rpm.stdout_lines
- name: acceptlicense
tags:
- install
shell: /opt/splunkforwarder/bin/splunk start --accept-license --answer-yes
register: accept_l
- debug: var=accept_l.stdout_lines
我过去只做过几本剧本,所以这个错误对我来说是新的。
有没有人有任何见解?
解决方案
Splunk 没有很好地记录这一点,但有两种方法可以做到这一点。
1) 在命令行上提供密码。 splunk start --accept-license --answer-yes --no-prompt --seed-passwd <passwd>
.
2) 创建一个 $SPLUNK_HOME/etc/system/local/user-seed.conf 文件
[user_info]
USERNAME = admin
PASSWORD = <password>
然后启动 Splunk:
splunk start --accept-license --answer-yes --no-prompt
推荐阅读
- c# - 通过 Partition 和 Row Key 检索数据时获取 null
- java - 类中的 main() 与接口中的 main()
- php - 未定义索引:级别
- django - 中级 Django 2.0 管理操作页面未显示
- csv - 在 NetLogo 中导入 CSV 文件
- python - 将 cookies txt 文件加载到 Python 中
- java - 为什么有人会在 java 1.8 的接口中定义静态方法?
- c# - linux 中单声道上的 iso-2022-jp 字符集(Amazon AMI)
- c# - 即使存在 C# selenium,也无法在页面上找到此元素
- assembly - memcmp 忽略奇数位置的字符