Files
env-ansible/tasks/general/scripts/root.yml
T
2026-10-02 11:23:02 -07:00

50 lines
1.3 KiB
YAML

---
# Create file to easily push git changes and call SCM.
- name: General | Scripts | Root | scm.sh
ansible.builtin.blockinfile:
path: "{{ user_root.home }}/bin/scm.sh"
block: |
# 20210211 - Make life easier!
time {{ ansible_pull_exec.stdout }} -U {{ git_repo_http }}
marker: '{mark}'
marker_begin: "#!{{ bash_exec.stdout }}"
marker_end: "exit 0"
state: present
create: true
- name: General | Scripts | Root | scm.sh Permissions
ansible.builtin.file:
path: "{{ user_root.home }}/bin/scm.sh"
mode: '0755'
- name: General | Scripts | Root | scm-dev.sh
ansible.builtin.blockinfile:
path: "{{ user_root.home }}/bin/scm-dev.sh"
block: |
# 20210713 - Make life easier for development!
## Variables ##
# Use a specific branch if it was asked for.
branch="dev"
if [[ $1 != "" ]]; then
branch="$1"
fi
## Main ##
time {{ ansible_pull_exec.stdout }} -U {{ git_repo_http }} --checkout $branch
marker: '{mark}'
marker_begin: "#!{{ bash_exec.stdout }}"
marker_end: "exit 0"
state: present
create: true
- name: General | Scripts | Root | scm-dev.sh Permissions
ansible.builtin.file:
path: "{{ user_root.home }}/bin/scm-dev.sh"
mode: '0755'