[ansible-project] combining set_fact with --start-at-task

2016-10-11 Thread jan . warchol
Hi, I have a play that sets some facts at the very beginning, using set_fact (I cannot use group_vars for defining these variables). Now, if this playbook fails and I rerun it using --start-at-task=something, the set_fact won't be ran and the playbook will fail. Is there any way of forcing "se

Re: [ansible-project] Re: How to force creating a new ssh connection

2016-03-29 Thread jan . warchol
I forgot that ansible_ssh_port and ansible_ssh_host may be unset. This version should work: # this will force Ansible to create new connection(s) so that changes in ssh # settings will have effect (normally Ansible uses ControlPersist feature to # reuse one connection for all tasks). Not

Re: [ansible-project] Re: How to force creating a new ssh connection

2016-03-29 Thread jan . warchol
Hello, thanks a lot! For the sake of people having the same problem as me, here's a complete task that kills connections to all hosts from the current play: # this will force Ansible to create new connection(s) so that changes in ssh # settings will have effect (normally Ansible uses Contr

[ansible-project] How to force creating a new ssh connection

2016-03-18 Thread jan . warchol
Hello, by default Ansible uses SSH's ControlPersist feature to reuse one ssh connection for running multiple tasks. This is very nice and helpful. However, there is one situation when this is a problem: when I change sshd configuration, I want Ansible to start a new connection so that it will

[ansible-project] Re: Downgrading apt packages safely

2016-03-03 Thread jan . warchol
Thanks! Unfortunately, this doesn't fully solve my problem: using "force: yes" will disable useful apt security checks. For example, with "force: yes" Ansible will install packages that cannot be authenticated - I don't want that. Is there a better way? best, Jan On Thursday, March 3, 2016

[ansible-project] Downgrading apt packages safely

2016-03-02 Thread jan . warchol
Hello, in my ansible playbook I want to ensure a specific version of a package is installed, even if that would mean downgrading it. I know that I can specify version together with package name, like this: haproxy=1.4.24-2. However, this is not enough in case of downgrading: this playbook -

[ansible-project] Where should I keep templates/config files that concern multiple applications?

2015-11-27 Thread jan . warchol
Hi, Let's say I have a deployment that consists of a bunch of services and a "meta-service" that is supposed to watch over each of them (this can be a monitoring agent, a log collector or whatever). I have separate roles for setting up each of them. However, this meta-service needs a specific