-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync with github.com/readytotouch-yaaws/yaaws-go
- Loading branch information
1 parent
f949d13
commit 54a4fdd
Showing
7 changed files
with
111 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,14 @@ | ||
ansible-ping: | ||
# https://askubuntu.com/questions/46424/how-do-i-add-ssh-keys-to-authorized-keys-file | ||
# https://askubuntu.com/a/262074 | ||
# cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" | ||
ansible -i ./scripts/ansible/hosts.txt all -m ping | ||
|
||
ansible-install-docker-compose: | ||
# https://docs.ansible.com/ansible/latest/network/getting_started/first_playbook.html | ||
ansible-playbook -i ./scripts/ansible/hosts.txt ./scripts/ansible/install-docker-compose-playbook.yml | ||
|
||
ansible-git-pull: | ||
ansible-playbook -i ./scripts/ansible/hosts.txt ./scripts/ansible/git-pull.yml | ||
|
||
# alias | ||
agp: ansible-git-pull | ||
|
||
ansible-make: | ||
ansible-playbook -i ./scripts/ansible/hosts.txt ./scripts/ansible/make.yml | ||
ansible-install-docker-compose: | ||
ansible-playbook -i ./scripts/ansible/hosts.txt ./scripts/ansible/install-docker-compose.yml | ||
|
||
ansible-shell: | ||
# ansible -i ./scripts/ansible/hosts.txt all -m shell -a "ps aux" | ||
ansible -i ./scripts/ansible/hosts.txt all -m shell -a "cd /var/go/u8views; env" | ||
ansible-install-go: | ||
ansible-playbook -i ./scripts/ansible/hosts.txt ./scripts/ansible/install-go.yml | ||
|
||
ansible-go-install: | ||
ansible-playbook -i ./scripts/ansible/hosts.txt ./scripts/ansible/go-install.yml | ||
ansible-install-nodejs: | ||
ansible-playbook -i ./scripts/ansible/hosts.txt ./scripts/ansible/install-nodejs.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,19 @@ | ||
--- | ||
# https://fabianlee.org/2021/02/03/ansible-cloning-a-git-repository-that-requires-credentials/ | ||
- name: "Git clone u8views" | ||
hosts: web | ||
gather_facts: no | ||
hosts: "web" | ||
gather_facts: "no" | ||
vars: | ||
- REPOSITORY: "https://github.com/u8views/go-u8views.git" | ||
- DESTINATION: "/var/go/u8views" | ||
|
||
tasks: | ||
- name: "/var/go/u8views" | ||
file: | ||
path: /var/go/u8views | ||
state: directory | ||
- name: "Ensure directory {{ DESTINATION }} exists" | ||
ansible.builtin.file: | ||
path: "{{ DESTINATION }}" | ||
state: "directory" | ||
|
||
- name: "git pull" | ||
- name: "Git pull repository {{ REPOSITORY }}" | ||
ansible.builtin.git: | ||
repo: https://github.com/u8views/go-u8views.git | ||
version: main | ||
dest: /var/go/u8views | ||
|
||
- name: "git status" | ||
shell: "git status" | ||
args: | ||
chdir: "/var/go/u8views" | ||
register: out | ||
when: false | ||
- debug: | ||
var: out.stdout_lines | ||
when: false | ||
|
||
- name: "ls -la" | ||
shell: "ls -la" | ||
args: | ||
chdir: "/var/go/u8views" | ||
register: out | ||
when: false | ||
- debug: | ||
var: out.stdout_lines | ||
when: false | ||
repo: "{{ REPOSITORY }}" | ||
version: "main" | ||
dest: "{{ DESTINATION }}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
- name: "Install Docker and Docker Compose" | ||
hosts: "web" | ||
gather_facts: "no" | ||
vars: | ||
- DOCKER_COMPOSE_VERSION: "2.22.0" | ||
|
||
tasks: | ||
- name: "Update apt cache" | ||
apt: | ||
update_cache: "yes" | ||
|
||
- name: "Install required packages" | ||
package: | ||
name: "{{ item }}" | ||
state: "present" | ||
loop: | ||
- "apt-transport-https" | ||
- "ca-certificates" | ||
- "curl" | ||
- "software-properties-common" | ||
|
||
- name: "Add Docker GPG key" | ||
apt_key: | ||
url: "https://download.docker.com/linux/ubuntu/gpg" | ||
state: "present" | ||
|
||
- name: "Add Docker APT repository" | ||
apt_repository: | ||
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" | ||
state: "present" | ||
|
||
- name: "Install Docker" | ||
package: | ||
name: "docker-ce" | ||
state: "present" | ||
|
||
- name: "Start and enable Docker service" | ||
service: | ||
name: "docker" | ||
state: "started" | ||
enabled: "yes" | ||
|
||
- name: "Install Docker Compose" | ||
get_url: | ||
url: "https://github.com/docker/compose/releases/download/v{{ DOCKER_COMPOSE_VERSION }}/docker-compose-{{ lookup('pipe', 'uname -s') }}-{{ lookup('pipe', 'uname -m') }}" | ||
dest: "/usr/local/bin/docker-compose" | ||
mode: "a+x" | ||
|
||
- name: "Get Docker version" | ||
command: "docker --version" | ||
register: "docker_version" | ||
- debug: | ||
var: "docker_version.stdout" | ||
|
||
- name: "Get Docker Compose version" | ||
command: "docker-compose --version" | ||
register: "docker_compose_version" | ||
- debug: | ||
var: "docker_compose_version.stdout" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
- name: "Install Node.js and npm" | ||
hosts: "web" | ||
gather_facts: "no" | ||
|
||
tasks: | ||
- name: "Update apt cache" | ||
apt: | ||
update_cache: "yes" | ||
|
||
- name: "Install Node.js and npm" | ||
apt: | ||
name: | ||
- "nodejs" | ||
- "npm" | ||
state: "present" | ||
|
||
- name: "Get Node.js version" | ||
shell: "node -v" | ||
register: "node_version" | ||
- debug: | ||
var: "node_version.stdout" | ||
|
||
|
||
- name: "Get npm version" | ||
shell: "npm -v" | ||
register: "npm_version" | ||
- debug: | ||
var: "npm_version.stdout" |
This file was deleted.
Oops, something went wrong.