ansible

skopeo inspect does not work behind proxy

*爱你&永不变心* 提交于 2020-01-06 05:37:04
问题 I am facing this while installing OKD 3.11. While the docker login works from command line, skopeo fail to do so. We are using http/https proxy on the server and have configured proxy for docker as well. [root@hostname-ansible01 openshift-ansible]# docker login registry.redhat.io:443 -u user_openshift -p password Login Succeeded [root@hostname-ansible01 openshift-ansible]# skopeo inspect --creds=user_openshift:password docker://registry.redhat.io:443/openshift3/ose-deployer:v3.11 FATA[0000]

I deploy my project by ansible, I always get the error: ImportError: No module named zipfile

我与影子孤独终老i 提交于 2020-01-06 05:30:17
问题 fatal: [45.76.146.29]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to 45.76.146.29 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1507867975.52-212330775158986/apt.py\", line 17, in \r\n import zipfile\r\nImportError: No module named zipfile\r\n", "msg": "MODULE FAILURE", "rc": 0} what cause this error? 回答1: You have some reduced installation of python on your system. I've seen such error on

Error in Mount Module in Ansible

别来无恙 提交于 2020-01-06 04:45:10
问题 I am trying to mount a remote directory. Following is the code: - name: mount the folder. mount: name=/mnt/point src="//sdfs601/master.src/scm/pkgs" fstype=auto opts="domain=td,username=uname,password=pass,file_mode=0777,dir_mode=0777" state=mounted But it is giving the following error: fatal: [153.64.221.181]: FAILED! => {"changed": false, "failed": true, "msg": "Error mounting /mnt/15.00: mount: special device //sdfs601/master.src/scm/pkgs does not exist\n"} But when i try mounting using

Ansible + Cisco idempotence

亡梦爱人 提交于 2020-01-06 03:15:35
问题 So I'm doing some testing with Ansible to manage Cisco devices (specifically a 3750 in this case). I'm able to add my VLAN's and Loopbacks with no issue. Just trying to get Ansible to stop registering a change in the task when the Loopback or VLAN exists. Right now my play looks like this: - name: Set the IP for Loop 0 ios_config: provider: "{{ connection }}" lines: - description AnsibleLoop0 - ip address 8.8.8.8 255.255.255.0 before: - interface Loopback0 match: exact Anytime this task is

How to skip all other plays in ansible playbook if some condition is not met?

馋奶兔 提交于 2020-01-06 02:25:27
问题 I have multiple plays in below playbook. I want to ignore all other plays if some condition is not met. So for below example - If I cannot find any new file in Play1 then I don't want to execute Play2 and Play3 at all (it should skip it). How can I do that? I have end_play in Play1 but it only skips Play1 and it still executes Play2 and Play3 --- - name: Play 1 hosts: 127.0.0.1 tasks: - name: find the latest file find: paths=/var/lib/jenkins/jobs/process/workspace/files file_type=file age=-1m

Ansible read multiple variables with same name from vars_file

岁酱吖の 提交于 2020-01-05 13:01:11
问题 In my ~/ip_vars_file , I have ip : 10.20.30 ip : 10.20.31 ip : 10.20.32 This is created with lineinfile, lineinfile: line="ip{{':'}} {{item.public_ip}}" dest="{{ansible_env.HOME}}/ip_vars_file}}" with_items: servers.tagged_instances #servers is registered in previous task I am unable to read all three ips as with_items. I get only the last IP in my playbook. --- - hosts: localhost tasks: - name: print ips debug: var: item with_items: "{{ ip }}" vars_files: - ~/ip_vars_file The output I am

Ansible read multiple variables with same name from vars_file

不想你离开。 提交于 2020-01-05 13:00:30
问题 In my ~/ip_vars_file , I have ip : 10.20.30 ip : 10.20.31 ip : 10.20.32 This is created with lineinfile, lineinfile: line="ip{{':'}} {{item.public_ip}}" dest="{{ansible_env.HOME}}/ip_vars_file}}" with_items: servers.tagged_instances #servers is registered in previous task I am unable to read all three ips as with_items. I get only the last IP in my playbook. --- - hosts: localhost tasks: - name: print ips debug: var: item with_items: "{{ ip }}" vars_files: - ~/ip_vars_file The output I am

Why does my custom Ansible module fail?

南楼画角 提交于 2020-01-05 11:01:30
问题 I am learning ansible so I wrote the most simple playbook and module I could think of, and it failed. My playbook --- - hosts: demo tasks: - name: install demo action: install My module echo "changed=True msg=OK" The following seems fine : bash script mode is 755 playbook is linked to module correctly This is the output: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "changed=True msg=OK\r\n", "msg": "MODULE FAILURE", "parsed": false} What am I doing wrong

简单web架构实例应用

拥有回忆 提交于 2020-01-05 10:57:58
一、架构图 dns完成解析web1,web2来实现负载均衡 web1,web2使用后台的mysql数据库 web1,web2的页面数据全部放在nfs数据上,实现自动挂载 nfs服务器为web1,web2提供网页数据 10.7.2. 准备工作 设置ip信息 nmcli con add ifname ens33 con-name ens33 type ethernet ipv4.method manual \ ipv4.address 192.158.46.150/24 ipv4.gateway 192.168.46.1 Note 我使用的nmcli修改的ip,当然也是可以手工修改的。 10.7.3. ansible的配置 10.7.3.1. 安装ansible [root@localhost ~]# yum install ansible 10.7.3.2. 添加主机 需要添加如下内容到/etc/ansible/hosts文件中去。 [client] 192.168.46.159 [dns] 192.168.46.158 [web] 192.168.46.157 192.168.46.156 [db] 192.168.46.155 [nfs] 192.168.46.154 [self] 192.168.46.150 10.7.3.3. 配置免密码登陆

Ansible group_vars

若如初见. 提交于 2020-01-05 09:14:58
问题 I'm trying to automate the deployment of sensu checks to each role that a host plays. I currently have a structure like group_vars/ nginx all In each group_vars file, I have defined the following: sensu_checks: - check_name - check_other_name So for example, in group_vars/all I'd have: sensu_checks: - check_raid - check_load - check_disk In group_vars/nginx I'd have: sensu_checks: - check_pid - check_http What I would like to know if it's possible would be to get all the checks that a