Select Page

ansible – upload files, set them executable, run and delete

--- - name: run some scripts on remote host hosts: myremotehost become: yes become_method: sudo vars: homefolder: "/home/{{ansible_user}}/" tasks: - name: copy files for ftp setup to new shlomi synchronize: src: "{{item}}" dest: "{{homefolder}}" mode: push with_items:...

Download crontabs for all users (Ubuntu version)

If you have Ubuntu only environment you can easily download all crontabs for all users from machines you need using this playbook. Just create folder “crontabs” in directory where you will run playbook or modify path in synchronize.dest (Made 2016/03 for...

ansible – built in variables

To see all available variables try command ansible -m setup hostname To get variables from remote instance you have to set “gather_facts: yes” in playbook. Here are some interesting ones: ansible_all_ipv4_addresses – array of IPv4 addresses...