ansible-playbook

Ansible to Windows using Kerberos not working

天大地大妈咪最大 提交于 2019-12-07 17:56:48
问题 I am attempting to use Ansible 1.9.0.1 to configure Windows servers using a domain user name. I have successfully setup the Linux Ansible control box and have been able to use basic auth to run ansible/ansible-playbook plays. However running with a domain user fails. Kerberos is enabled on the Windows nodes: winrm get winrm/config/client/auth Auth Basic = true Digest = true Kerberos = true Negotiate = true Certificate = true CredSSP = true The playbook I am trying to run just references the

Ansible run task once per database-name

▼魔方 西西 提交于 2019-12-07 15:26:18
问题 I'm using ansible to deploy several sites to the same server. Each site is a separate 'host' in the ansible hosts inventory, which works really well. However, there are only two databases: production and testing. How can I make sure my database-migration task only runs once per database? I've read into the group_by , run_once and delegate_to features, but I'm not sure how to combine those. The hosts look something like: [production] site1.example.com ansible_ssh_host=webserver.example.com

Ansible output formatting options

落爺英雄遲暮 提交于 2019-12-07 14:32:13
问题 Is there an option to format ansible output with the use of ansible (not any other scripts)? For instance name: Show version sudo: true hosts: web_front_end tasks: - name: Create yum cache shell: yum makecache - name: Check the version of Portal shell: rpm -qa | grep portal register: portal - debug: msg={{portal.stdout}} tags: - portal - wfe I would like to get only the TASK: [debug msg={{portal.stdout}}] part. Or even is there a way to get only the shell command output? 回答1: I have a plugin

Creating multiple times the same role, but with different items

删除回忆录丶 提交于 2019-12-07 08:10:44
问题 I have a playbook that prepare 3 different Vagrants in my machine, so I have create a role that create this Vagrant. I don't find the correct syntax. It looks like roles is not a module, so I don't have all options, only tutorials. playbook file : - hosts: localhost connection: local roles : - role: vagrant with_items: - {index: 1, ip: 192.168.222.1, name: mongo1, user: nicorama } - {index: 2, ip: 192.168.222.2, name: mongo2, user: nicorama } - {index: 3, ip: 192.168.222.3, name: mongo3, user

Getting root privileges in ansible

旧巷老猫 提交于 2019-12-07 07:43:17
问题 I have the following task in ansible: - file: "state=directory path=/servers/repo" sudo: yes name: "Create the base site directory." which should run as my user but with root privileges. But even though my user is a sudoer it fails with Sorry, user sofiab is not allowed to execute '/bin/sh -c echo SUDO-SUCCESS-amlzcqzchzpjsgkllckjhjfednpjgevj; LANG=C LC_CTYPE=C /usr/bin/python /home/sofiab/.ansible/tmp/ansible-tmp-1409321488.66-202796192861545/file; rm -rf /home/sofiab/.ansible/tmp/ansible

Running Oracle SQL scripts with Ansible playbook

对着背影说爱祢 提交于 2019-12-07 06:49:39
问题 A look at the core database modules in Ansible documentation shows no signs of a module for Oracle. What is the best way to handle SQL/PLSQL deployments via Ansible for Oracle databases? Are we expected to use roles from Ansible Galaxy to handle this? Very few people seem to have downloaded roles listed on Galaxy for Oracle. 回答1: I have created a role to install apex 5 (where I first uninstall apex 4). I use modules like 'script' and 'shell'. I am not too happy about environment

Keep Ansible DRY: How to avoid repeating variables?

霸气de小男生 提交于 2019-12-07 05:37:18
问题 Recently just started using Ansible and I have run into a problem. In one of my YAML structures I have defined something like this: --- # file: main.yml # # Jenkins variables for installation and configuration jenkins: debian: # Debian repository containing Jenkins and the associated key for accessing the repository repo: 'deb http://pkg.jenkins-ci.org/debian binary/' repo_key: 'http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key' # Dependencies needed for Jenkins to run properly dependencies

How to keep local roles separated from the ones loaded from ansible-galaxy?

别等时光非礼了梦想. 提交于 2019-12-07 04:58:53
问题 I observed that roles downloaded from galaxy get installed inside the roles/ directory, where we already have our in-house ones, making quite hard to distiguish between external ones and internal ones. Is there a way to keep them in separated directories, so we can avoid confusions? In most cases I would expect to have a script that is updating the galaxy ones and that we would not modify them internally. 回答1: I think there is no standard way of doing this but you can use Ansibles behavior to

Ansible: playbook calling Role in a directory that is in the roles directory

牧云@^-^@ 提交于 2019-12-07 04:07:25
问题 I would like to shape my directory structure of my ansible roles and playbooks. Currently I have a directory structure like. group_vars * all * group-one - group-vars.yml - group-vault.yml ... host_vars - server1.yml plays - java_plays * deploy_fun_java_stuff.yml * deploy_playbook.yml roles - role1 - tasks * main.yml - handlers - (the rest of the needed directories) - role2 - java - java_role1 - tasks * main.yml - handlers - (the rest of the needed directories) I would like to be able to call

Getting the IP address/attributes of the AWS instance created using Ansible

坚强是说给别人听的谎言 提交于 2019-12-06 22:32:13
问题 I know how to create an AWS instance using Ansible. Now what I want to achieve is to configure that instance as web server by installing nginx using the same playbook which created the instance. The goal of the playbook will be: Create an AWS instance. Configure the instance as Web server by setting up the Nginx server. Is it possible with ansible? 回答1: Read http://www.ansible.com/blog/ansible-ec2-tags It details how to spin up an ec2 instance (or multiple) and then run tasks against it (I.e