ansible-playbook

Nginx error: (13: Permission denied) while connecting to upstream

为君一笑 提交于 2019-12-17 10:33:55
问题 I am getting this error in my nginx-error.log file: 2014/02/17 03:42:20 [crit] 5455#0: *1 connect() to unix:/tmp/uwsgi.sock failed (13: Permission denied) while connecting to upstream, client: xx.xx.x.xxx, server: localhost, request: "GET /users HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "EC2.amazonaws.com" The browser also shows a 502 Bad Gateway Error. The output of a curl is the same, Bad Gateway html I've tried to fix it by changing permissions for /tmp/uwsgi.sock to 777.

exec $SHELL executes from SSH, won't execute in playbook

徘徊边缘 提交于 2019-12-14 02:57:20
问题 I'm trying to provision Ruby + Rails on a guest VM. Here's what I have in my playbook.yml : --- - hosts: all sudo: true tasks: - apt: update_cache=yes - apt: name={{ item }} state=present with_items: - build-essential - git-core - zlib1g-dev - libssl-dev - libreadline-dev - libmysqlclient-dev - libyaml-dev - libxml2-dev - libxslt1-dev - libcurl4-openssl-dev - python-software-properties - libffi-dev - curl - command: git clone git://github.com/sstephenson/rbenv.git .rbenv - shell: echo 'export

Rolling restart with ansible handlers

ぐ巨炮叔叔 提交于 2019-12-14 00:46:22
问题 I want to run an ansible playbook that installs a service and restarts it if anything has changed since the last run (more or less the canonical use-case for ansible handlers). But I want a different parallelism for installing than for restarting: I want to install on all the hosts at a time but, if the "service-restart" handler gets invoked I want that to run on X hosts at a time. I know this is possible with different plays that have different serial values. But I can't see how I could make

the dir parameter for calling roles

陌路散爱 提交于 2019-12-13 08:07:11
问题 I've got this bit in my playbook. roles: - {role: cleanup-create, dir: '/standard/', commit: "{{choice}}"} The file structure is /roles/standard/cleanup-create/tasks/main.yml And yet I receive this error: ERROR! the role 'cleanup-create' was not found in /home/myuser/network-ansible-myuser/roles:/home/myuser/network-ansible-myuser:/etc/ansible/roles The error appears to have been in '/home/myuser/network-ansible-myuser/configure-files.yml': line 15, column 5, but may be elsewhere in the file

ansible- expect module with cisco ios switch

被刻印的时光 ゝ 提交于 2019-12-13 06:32:13
问题 If I try to use expect module in YAML file like this: name: some tests hosts: sw-test gather_facts: False tasks: - name: do reload in case of "catting off" expect: command: reload in 30 responses: 'Reload scheduled in 30 minutes by admin on vty0 (192.168.253.20)\nProceed with reload? \[confirm\]' : y echo: yes But there is a problem with connection: root@Kali:/etc/ansible# ansible-playbook test3 -u admin -k -vvvv Using /etc/ansible/ansible.cfg as config file SSH password: Loaded callback

Invoke Ansible playbook in Jenkins

走远了吗. 提交于 2019-12-13 06:11:47
问题 I have jenkins build and I am trying to invoke a ansible playbook file for an s3 upload. When I execute a post-build-script for invoking an ansible playbook file, I am ending with below error. Cannot run program "ansible-playbook" (in directory "/var/jenkins_home/workspace/mybuild"): error=2, No such file or directory Below screenshot is ansible post build script configuration. FYI: There is a file(ansibledemo.yml) in my build folder. I tried giving absolute path(/var/jenkins_home/workspace

Ansible condition always evaluates to false

拜拜、爱过 提交于 2019-12-13 04:06:56
问题 I'm trying to examine the output of a shell command for a particular string which indicates an error, and that the playbook should be terminated. I'm trying to debug it something like this: - debug: var=foo_result - debug: msg={{ 'Some error text' in foo_result }} In this example, install_result was registered to contain the output of the command, and it does: TASK: [do_stuff | debug var=foo_result] **************************** ok: [some-node] => { "foo_result": { "changed": true, "msg": "All

Ansible not allowing environment at playbook level

半腔热情 提交于 2019-12-12 18:13:49
问题 I'm having issues defining environment variables at playbook level. According to the docs it should be possible. $ ansible --version 1.7.1 $ ansible-playbook -i staging deploy.yml ERROR: environment is not a legal parameter at this level in an Ansible Playbook Here's the playbook simplified: --- - hosts: app user: web environment: PATH: "{{ path_append }}:{{ ansible_env.PATH }}" tasks: - ... - ... Just to make sure, I tried setting it without the variables, and the result was equal. Moving

Run a postgresql command with ansible playbook. Postgresql requires password

a 夏天 提交于 2019-12-12 16:18:38
问题 I would like to write an Ansible playbook which tries to handle some postgresql command. I did earlier a similar playbook, but in that case Postgresql didn't need password. I thought I could use my old playbook, which works fine, but I was wrong. This database requires password. I know that Ansible has postgresql support which is fine (postgresql_db, postgresql_ext, postgresql_lang, postgresql_privs, postgresql_user) and with them I can do half of the work and it handles password just fine,

Running the Following Playbook syntax appears to be correct but getting following ERROR!- 'blockinfile' is not a valid attribute for a Play

Deadly 提交于 2019-12-12 14:46:08
问题 Running the Following Playbook syntax appears to be correct but getting following ERROR!- ERROR! 'blockinfile' is not a valid attribute for a Play The error appears to have been in '/root/playbook1.yml': line 2, column 3, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: --- - name: insertupdate ^ here My Playbook file code is: --- - name: insertupdate blockinfile: dest: /etc/network/interfaces block: | iface eth2 inet static address 192