I'm using Ansible to try to configure all of the workstations involved with a particular project to be able to use BitTorrent sync with a standard configuration (this is actually just an example of the kind of thing I want to do).
When I execute the playbook I can confirm that the debconf settings on the remote PCs have been updated, however the config file for the application has not been updated.
Is there a way to get ansible to finish the job off - having supplied a bunch of config data I just want to recompile the actual config file and then restart the service.
I'm using the latest Ansible (from PyPi) on Ubuntu 14.10 64bit hosts.
- hosts: btsync sudo: True tasks: - apt_repository: repo='ppa:tuxpoldo/btsync' update_cache=yes state=present - apt: name=btsync state=present - apt: name=debconf-utils state=present - apt: name=btsync-gui state=present - file: name='create a directory for BT Sync' path=/home/sal/bittorrent_sync state=directory owner=sal group=users mode=0755 - debconf: name='btsync' question='btsync/runas' value='sal' vtype='string' - debconf: name='btsync' question='btsync/directory_root' value='/home/sal/bittorrent_sync' vtype='string' - debconf: name='btsync' question='btsync/webgui-bindaddr' value='0.0.0.0' vtype='string' - debconf: name='btsync' question='btsync/folder_defaults-use_lan_broadcast' value='true' vtype='boolean' - debconf: name='btsync' question='btsync/log_size' value='1' vtype='string' - debconf: name='btsync' question='btsync/folder_defaults-use_dht' value='true' vtype='boolean' - service: name='btsync' state=restarted
I can force the config file to be reconfigured from the debconf like this:
sudo dpkg-reconfigure -f noninteractive btsync
I suppose I could force Ansible to remotely execute that statement, but surely there's a better, more ansibleish way to do this?