New answers tagged

0

I'm not familiar with spacecmd, but you can use the wait_for module to monitor the PID. From docs: - name: Wait until the process is finished and PID was destroyed wait_for: path: /proc/3466/status state: absent


0

Ansible can reboot the server without using spacecmd, using the reboot command. - name: Upgrading via spacewalk shell: spacecmd system_upgradepackage <hostname> '*' -y - name: Reboot after upgrades shell: reboot async: 0 poll: 0 - name: Waiting for host to come up local_action: wait_for host={{ ansible_ssh_host }} state=started Adapted ...


1

You could run a shell command through ansible. - name: suspend "{{ ansible_hostname }}" command: systemctl suspend As for waking them up again: Wake-On-LAN?


1

Problem could be that it is not an executable chmod should do it and also maybe I'd change ENTRYPOINT to CMD as default entrypoint is /bin/sh -c


1

TLDR; All jinja2 template expressions must be quoted in your playbook when they start with double curly braces else you will get a syntax error (Which is what you get I guess) You should write your task like the following to clear your error and set your envs to your passed extra vars: - name: Create a data container docker_container: name: ...


0

This might do what you want (ansible 2.8) -e 'name1_var=""testa"" name2_var=""testb"" name1_var3=""testc""'


1

Set auto_remove: yes, tty: yes, and I believe interactive: yes, but that may be wrong, I'm just guessing based on a brief Google. Credit where credit is due for the first half of my answer: https://stackoverflow.com/questions/35298664/way-to-set-rm-flag-for-ansible-docker-module Look through the options here if you ever need to set a flag and see if any ...


3

I assume you only want to display this data not to do anything with it: --- - hosts: all tasks: - name: show filesystems debug: msg: "mount: {{ item.mount }}, available: {{ item.size_available | human_readable }}" loop: "{{ ansible_mounts }}" loop_control: label: "" This playbook will display mountpoint and avaiable ...


Top 50 recent answers are included