我有一个ansible-role,它的任务是解压一个没有第一级目录的.zip文件。
Ansible-task:
- name: Cryptography support - download & unarchive jce_policy-8.zip
unarchive:
extra_opts: -j
src: https://###.nexus.###.com/repository/oracle_jdk/java/jce/8/jce_policy-8.zip
dest: "{{java_cryptography_path}}"
remote_src: yes
tags:
- cryptography哪里,
{{java_cryptography_path}}= /usr/java/default/jre/lib/security/这在azure云实例上的Centos7.5服务器上失败,但在openstack云实例上的Centos7.3服务器上成功
这是详细的警告
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
File "/tmp/ansible_unarchive_payload_KHaxre/ansible_unarchive_payload.zip/ansible/module_utils/basic.py", line 1071, in selinux_context
ret = selinux.lgetfilecon_raw(to_native(path, errors='surrogate_or_strict'))有没有人能帮帮我。谢谢!
发布于 2019-04-12 07:52:41
通过调试解决了这个问题。我想对于遇到类似问题的人来说,分享它可能会有所帮助。
这就是ansible unarchive.py模块的编写方式。因为我试图配置的远程服务器有selinux: enabled,所以tt失败了。我们所需要做的就是根据您的组织规则暂时或永久禁用它。
ansible文档中有一个关于这方面的示例任务。docs.ansible.com/ansible/latest/modules/selinux_module.html
我们还应该在selinux is disabled之后对系统执行reboot。在ansible文档中也有这样的例子,docs.ansible.com/ansible/latest/modules/reboot_module.html
https://stackoverflow.com/questions/55485085
复制相似问题