connection: local
tasks:
- - name: Do nothing
- ansible.builtin.shell: echo "Nothing to do."
+ - name: Do nothing
+ ansible.builtin.shell: echo "Nothing to do."
EOF
fi
fi
+if [ "$1" == "reset" ]; then
+ read -n1 -p "Reset $TASKFILE? [y,N]" input
+ if [[ ! $input == "Y" && ! $input == "y" ]]; then
+ echo "Aborted by user"
+ exit 1
+ fi
+ echo "$EMPTY_TASKFILE" > $TASKFILE
+fi
+
+
if [ "$1" == "check" ]; then
$ANSIBLE $TASKFILE --check --diff
fi
-if [ "$1" == "link" ]; then
- echo "wait"
-fi
-echo << EOF
-- name: Create a symbolic link
- ansible.builtin.file:
- src: /file/to/link/to
- dest: /path/to/symlink
- owner: foo
- group: foo
- state: link
-EOF
-echo "heh"
+if [ "$1" == "link" ]; then
+ if [ ! -n "$2" ]; then
+ echo "May symlink:"
+ cd $HOME/dotfiles/files
+ ls -p | grep -v /
+ fi
+read -d '' LINK_FILE << EOF
+---
+ tasks:
+ - name: Create a symbolic link
+ ansible.builtin.file:
+ src: /file/to/link/to
+ dest: /path/to/symlink
+ owner: foo
+ group: foo
+ state: link
+EOF
-if [ "$1" == "reset" ]; then
- read -n1 -p "Reset $TASKFILE? [y,N]" input
- if [[ ! $input == "Y" && ! $input == "y" ]]; then
- echo "Aborted by user"
- exit 1
- fi
- echo "$EMPTY_TASKFILE" > $TASKFILE
fi
+