Hyperling 451e76559d
Add Git Server To Keep ansible-pull Traffic Local (#21)
* Fedora Minimal does not come with tar. Need installed for Telegraf.

* First attempt at automating HTTP git server setup.

* Add cron jobs to keep projects up to date.

* Add new git playbook to server.

* Add new server variables for git. Put all variables in a dictionary.

* Put variables into run file.

* Fix the loop variables to be dictionaries, not jinja.

* Upgrade nanominer.

* Attempt to fix templating error.

* Attempt to fix templating error, but in the right spot this time. :)

* Attempt another fix for building list of dictionaries.

* Change strings to dicts.

* Add quotes for jinja variables.

* Remove extra curly brackets.

* Fix the rest of the file's dictionaries now that General works.

* Remove testing code.

* Variablize ansible repo. Begin watching personal repos rather than pinging GitHub.

* Fix variables to append, not replace.

* Fix variable names.

* Try to prevent variables from being strings, without getting formatting error.

* Try to fix variables, again.

* Fixed git.yml. Found a way to test locally and all is working now.
2021-12-24 14:55:21 -06:00

71 lines
1.7 KiB
YAML

---
# Create file to easily push git changes and call SCM.
- name: General | Scripts | User | scm.sh
blockinfile:
path: "{{ user_user.home }}/bin/scm.sh"
block: |
# 20210211 - Make life easier!
push.sh
time curl https://scm.hyperling.com | sudo bash
marker: '{mark}'
marker_begin: "#!{{ bash_exec.stdout }}"
marker_end: "exit 0"
state: present
create: yes
- name: General | Scripts | User | scm.sh Permissions
file:
path: "{{ user_user.home }}/bin/scm.sh"
mode: '0755'
- name: General | Scripts | User | push.sh
blockinfile:
path: "{{ user_user.home }}/bin/push.sh"
block: |
# 20210215 - Make life even easier!
ssh {{ user }}@leet "cd Code/Ansible/ansible-pull; git push"
marker: '{mark}'
marker_begin: "#!{{ bash_exec.stdout }}"
marker_end: "exit 0"
state: present
create: yes
- name: General | Scripts | User | push.sh Permissions
file:
path: "{{ user_user.home }}/bin/push.sh"
mode: '0755'
- name: General | Scripts | User | scm-dev.sh
blockinfile:
path: "{{ user_user.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 ##
push.sh
time sudo {{ ansible_pull_exec.stdout }} -U {{ repo_github }} --checkout $branch
marker: '{mark}'
marker_begin: "#!{{ bash_exec.stdout }}"
marker_end: "exit 0"
state: present
create: yes
- name: General | Scripts | User | scm-dev.sh Permissions
file:
path: "{{ user_user.home }}/bin/scm-dev.sh"
mode: '0755'