Refactor to be a bit more modular
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
- name: Create test script to determine if reboot is necessary
|
- name: Create test script to determine if reboot is necessary
|
||||||
hosts: all
|
hosts: arch debian firewall
|
||||||
tasks:
|
tasks:
|
||||||
- name: Create ~/bin if it doesn't already exist
|
- name: Create ~/bin if it doesn't already exist
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
@@ -12,11 +12,11 @@
|
|||||||
print '#!/usr/bin/env zsh' > needs_reboot
|
print '#!/usr/bin/env zsh' > needs_reboot
|
||||||
source ~/.zsh_functions
|
source ~/.zsh_functions
|
||||||
declare -f kernel_func >> needs_reboot
|
declare -f kernel_func >> needs_reboot
|
||||||
perl -pi -e 'if (/OK/) { $_ = "false\n" }' needs_reboot
|
perl -pi -e 'if (/OK/) { $_ = "\t\techo no\n" }' needs_reboot
|
||||||
perl -pi -e 'if (/needs reboot/) { $_ = "true\n" }' needs_reboot
|
perl -pi -e 'if (/needs reboot/) { $_ = "\t\techo yes\n" }' needs_reboot
|
||||||
printf "\n\n\nkernel_func\n" >> needs_reboot
|
printf "\n\n\nkernel_func\n" >> needs_reboot
|
||||||
chmod +x needs_reboot
|
chmod +x needs_reboot
|
||||||
args:
|
args:
|
||||||
creates: needs_reboot
|
#creates: needs_reboot
|
||||||
executable: /usr/bin/zsh
|
executable: /usr/bin/zsh
|
||||||
chdir: ~/bin/
|
chdir: ~/bin/
|
||||||
|
|||||||
Reference in New Issue
Block a user