I have several hosts to manage and, in order to access them, i have to use
a couple of different ssh keys (and I set the ansible_ssh_private_key_file
in the inventory file to tell ansible which key to use).
The thing is that i've been maintaining 2 inventory files versions (which
is a pain): one f
Hi Kai,
On 01-09-16 22:46, Kai Stian Olstad wrote:
Are you trying to make all the users on all the sites?
If so, check out with_nested
https://docs.ansible.com/ansible/playbooks_loops.html#nested-loops
Thank you for your suggestion. That was the solution :) In #ansible
agaffney mentioned tha
is anyone using docker_login with Google Cloud Registry?
I am attempting to do so by defining variable for auth token:
gcloud_token_file: gcp_sa_account.json
gcloud_token: "{{ lookup('file', gcloud_token_file) }}"
and then trying to login:
docker_login: username="_json_key" password="{{ gcloud_
I current have one playbook for each application in my infrastructure: one
for Gerrit, one for Jenkins, etc. Current filesystem structure:
playbooks
|
gerrit
|
--- roles
|
postfix
jenkins
|
--- mas
On 01. sep. 2016 22:20, Patrick Laimbock wrote:
Variables:
---
openvpn_networks:
site1:
openvpn_config: site1-server1
site2:
openvpn_config: site2-server1
openvpn_users:
- name: patrick
base: /home/
- name: test
base: /home/
The task below works (apologies for the wra
Hi,
I want to deploy a couple of OpenVPN configs to multiple users. It works
for a single user but now I'm stuck trying to make it work for multiple
users. Anyone have a suggestion how to make this work?
Variables:
---
openvpn_networks:
site1:
openvpn_config: site1-server1
site2:
Hello,
I'm currently building some servers in AWS. A set of servers will need a
sequence of keys generated for each server like so, with a template that
get's pushed out.
# server 1
9011
9012
9013
# server 2
9021
9022
9023
# server 3
9031
9032
9033
If my inventory is dynamic, what is a good
Much better solution. Thanks!
I ended up doing this
- include_vars: "roles/syslog/vars/{{ ansible_os_family }}-{{
ansible_distribution_major_version }}.yml"
On Thursday, September 1, 2016 at 2:07:23 PM UTC-4, Allen Sanabria wrote:
>
> include_vars is your friend.
>
> For instance in tasks you
Additionally you can make syslog_service a dictionary value with keys for
the different versions:
vars/main.yml
syslog_service:
"6": syslog
"7": rsyslog
Then just do:
- name: Ensure syslog is running
service: name="{{ syslog_service[ansible_distribution_major_version] }}"
state=runnin
include_vars is your friend.
For instance in tasks you can say..
```yaml
- include_vars: RedHat6.yml
when: ansible_os_family == "RedHat" and ansible_lsb.major_release == "6"
- include_vars: RedHat7.yml
when: ansible_os_family == "RedHat" and ansible_lsb.major_release == "7"
```
On Thu, Sep
include_vars is your friend.
For instance in tasks/main.yml you can say..
- include_vars: RedHat6.yml
when: ansible_os_family == "RedHat" and ansible_lsb.major_release == "6"
- include_vars: RedHat7.yml
when: ansible_os_family == "RedHat" and ansible_lsb.major_release == "7"
On Thursday, Sep
Having a lot of -name/when task blocks is just ugly infrastructure. I have
to think of a better way. There's GOT to be a better way.
On Thursday, September 1, 2016 at 1:45:02 PM UTC-4, Kai Stian Olstad wrote:
>
> On 01. sep. 2016 18:02, ZillaYT wrote:
> > I'm writing a role to configure syslog,
On 01. sep. 2016 18:02, ZillaYT wrote:
I'm writing a role to configure syslog, and of course the service is
different between Linux instances. How do I do this in var/main.yml?
The directory must be vars not var.
# pseudo-code in vars/main.yml
if Redhat7.x
syslog_service: rsyslog
else if R
On 01. sep. 2016 16:57, synova.market...@gmail.com wrote:
Hi,
Is there a way to do the same as "with_items" but globally for the playbook?
For example something like :
variable1:
- {url: 'http://someting', dest: 'something', src: 'something'}
- {url: 'http://someting2', dest: 'something2',
try win_package - win_msi is *only* for (well behaved) msi files.
also win_chocolatey is an option for a lot of places if it meets your
security requirements.
A lot of (older) .exe programs will assume there is a user and pop up some
kind of dialog box, which will cause the module to hang indef
So I guess to answer your question directly, there is no way to access
tags, skip tags, limit and most other command line options from within a
play.
It's really only achievable via a callback.
On Thu, Sep 1, 2016 at 11:26 AM, Jordan Cohen wrote:
> The callback plugin is really nice, i didn't k
The callback plugin is really nice, i didn't know it existed.
For my purposes though, I would like to use the slack module so that I can
more custom tailor the message, the channel to post to, and when to skip a
slack message (for local/dev environments)
But thank you, this is cool.
On Thursd
Jordan,
Have you looked at the slack callback plugin that is already bundled with
ansible?
In your ansible.cfg you would need to have something like:
[defaults]
callback_whitelist = slack
The docstring for the callback has information about what environment
variables need to be set up for it to
That's not us calling that, it's the Azure Python SDK calling itself, so
something is internally out of sync (possibly stale .pyc files?). The way
they package "azure" as a empty meta-package that depends on lots of other
packages makes it really easy for things to get out of sync, especially
w
I'm writing a role to configure syslog, and of course the service is
different between Linux instances. How do I do this in var/main.yml?
# pseudo-code in vars/main.yml
if Redhat7.x
syslog_service: rsyslog
else if RedHat6.x
syslog_service: syslog
end
So then I can just do this in tasks/main
Hi there,
I want to manage AIX machines with ansible, but there is no python
installed. Since python is quite heavy I found the lightweight pypy.
But even pypy has build dependencies, most of them are not present in my
environment.
When I read this correct, pypy can be build without all those de
So courtesy of a few colleagues we have a solution. By specifying the fqdn in
the inventory rather than the ip, and making sure the Ansible control machine
could resolve the fqdn to the ip, the connection is now successful.
--
You received this message because you are subscribed to the Google G
Hi,
Is there a way to do the same as "with_items" but globally for the playbook?
For example something like :
variable1:
- {url: 'http://someting', dest: 'something', src: 'something'}
- {url: 'http://someting2', dest: 'something2', src: 'something2'}
and use it like this in the playbook.
I'll answer this for myself. Seems like just using the command module and
doing the copy that way is the best approach.
Thanks for putting me on the right track!
On Wednesday, August 31, 2016 at 7:09:22 PM UTC-5, Jon Langemak wrote:
>
> Thank you! Is there a better means to recursively copy th
The whole test playbook is here;
- hosts: windows
gather_facts: false
tasks:
- name: Change Administrator password
win_user: name=Administrator password=Quaiqu6I
password_never_expires=yes
Running with ansible 2.1.1.0, and Windows 2012 R2 as client.
http://pastebin.com/2Wg9qYMt
Hello,
It is possible to limit the hosts the ansible command runs against by
specifying patterns on the command line like so:
ansible webservers:!staging -m ping
Is it possible to use the same technique to define groups in the inventory
file, so that the new group is defined by the intersecti
Hi,
Currently, I'm transforming my user role from creating one user to creating
multiple users. In many examples I've seen this is done by adding with_items
to every tasks related to the creation of the user (create user, add
authorized key, etc). This would result in executing every tasks for
I am integrating some automated slack messaging in ansible to inform on
ansible runs and it would be useful to display information such as:
Current tags in push
Current skip-tags in push
Current limit (though I know i can use play_hosts for listing the servers)
To be honest, the whole ansible co
Hi Peter,
many thanks for your help, it works now!
On Tuesday, August 30, 2016 at 4:26:08 AM UTC+2, Peter Sprygada wrote:
>
> Hi Rukka,
>
> See sample playbook here:
> https://gist.github.com/privateip/f473d9ce25dd699b14c9987264159616
>
>
>
> On Mon, Aug 29, 2016 at 5:23 AM, Rukka Pal
> > wrote
Hi,
I'm trying to install a software(.exe file) using raw module in windows but
failed to do.
- hosts : all
remote_user: administrator
tasks:
- raw : xxx.exe /s
Is there any other module to install software from .exe files?? I tried
win_msi but it didnt work.
--
You received this
I have the following task which uses with_nested with variables that could
be empty.
- name: Authorize SSH keys for all website users.
authorized_key:
user="{{ item.0.user | default(websites_default_user) }}"
key="{{ lookup('file', 'data/public-ssh-keys/' ~ item.1.key) }}"
key_optio
To provide a bit more detail, if I have this in my inventory file;
ec2-XXX-XXX-XXX-XXX.eu-west-1.compute.amazonaws.com ansible_ssh_user=ec2-user
ansible_ssh_pass=dummy
And run this;
$ ansible all -i inventory/aws -m ping -
No config file found; using defaults
Loaded callback minimal of typ
I'm running Ansible 2.1.1.0 on OS X 10.11.6 and I'm having a problem that I
haven't had before. The issue the same as outlined in this SO question;
https://stackoverflow.com/questions/37213551/ansible-ssh-connection-fail
If I don't put ansible_ssh_pass in the inventory file then SSH doesn't
wor
to get round that issue you need to set
ansible_winrm_server_cert_validation: ignore
In your inventory / group vars
its documented here:
http://docs.ansible.com/ansible/intro_windows.html#inventory
Hope this helps,
Jon
On Thursday, September 1, 2016 at 11:13:02 AM UTC+1, ishan jain wrote:
>
On 01. sep. 2016 12:39, Uwe Sauter wrote:
Yes, that I've alredy figured out. But what if I want to group my playbooks
inside different folders but the group and host vars
should be the same? Is there an option to tell Ansible where to look for those
folders?
I don't think that is possible. Yo
On 01. sep. 2016 11:00, fanvalt wrote:
Hello,
I want to set variables with set_fact in a pre_tasks section.
This is working well, but it is 50 lines long and I want to have these
lines to be set in all my playbooks.
Is there a way to include a pre_tasks ? Here is what I would expect:
- includ
Yes, that I've alredy figured out. But what if I want to group my playbooks
inside different folders but the group and host vars
should be the same? Is there an option to tell Ansible where to look for those
folders?
I imagine a dir tree like:
.
├── group_vars
│ ├── group1.yaml
│ └── group2
It can be inside the same folder as the playbook.
root
-- group_vars/all.yml
-- host_vars/some_host.yml
-- myPlaybook.yml
On Thursday, September 1, 2016 at 2:40:10 PM UTC+5:30, Uwe Sauter wrote:
>
> Hi all,
>
> I'm currently struggling with how to tell Ansible where it can find
> host_var
Hi
I have a need to call ansible from python. I was looking
at http://docs.ansible.com/ansible/developing_api.html#python-api-2-0 but
doc doesn't seem to be very clear.
I need to execute a module or a playbook which ever is easy and want the
response of it. Basically this is my custom module w
I am making some centOS based docker containers to be used as Ansible host.
Initially, i created a container and installed Ansible from source files.
To connect to windows hosts, i installed some modules as and when required.
(honestly, i am not sure what all modules i installed)
Now i created
Hi all,
I'm currently struggling with how to tell Ansible where it can find host_vars
and group_vars folders. Is there an environmet
variable for it? Does it have to be inside the same folder as the playbook?
Regards,
Uwe
--
You received this message because you are subscribed to the
Hello,
I want to set variables with set_fact in a pre_tasks section.
This is working well, but it is 50 lines long and I want to have these
lines to be set in all my playbooks.
Is there a way to include a pre_tasks ? Here is what I would expect:
pre_tasks:
- name: variables Instance 1 DV/
ok thank you for the explanation
REgards
Le mercredi 31 août 2016 12:50:55 UTC+2, Kai Stian Olstad a écrit :
>
> On 31. aug. 2016 11:43, fanvalt wrote:
> > Hello,
> >
> > I don't understand where I am doing wrong in this simple tasks:
> >
> > - name: Search for bin directory
> > stat:
> >
Hi,
I wonder if you are somehow picking up an old version of the modules, as I
just checked (latest devel 2.2 version and
If ($params.start_mode) {
is no longer in the code.
If you are running from source ensure you have done a git submodule update
--init and a source hacking/env-setup other
win_copy is still unfortunately not great for large files. From the
testing that I did earlier in the year it is still slower than fetching the
same size file via http and there seems to be a max size, although this
isn't something I've hit myself.
What I do is add an http server (nginx) to my
45 matches
Mail list logo