myos
This commit is contained in:
@@ -23,13 +23,6 @@ hosts_cloudinit_config:
|
||||
hosts_cloudinit_enable: false
|
||||
```
|
||||
|
||||
* `hosts_git_repositories` - Clone git repositories
|
||||
|
||||
``` yaml
|
||||
hosts_git_repositories:
|
||||
- { "repo": "https://github.com/aya/myos", "dest": "/src/com/github/aya/myos", "key_file": "~/.ssh/id_rsa", "version": "master" }
|
||||
```
|
||||
|
||||
* `hosts_packages` - List of packages to install/remove on your hosts, should be overrided for a specific distro
|
||||
|
||||
``` yaml
|
||||
|
||||
@@ -78,9 +78,6 @@ hosts_cloudinit_config:
|
||||
# enable cloud-init
|
||||
hosts_cloudinit_enable: false
|
||||
|
||||
# git repositories to clone
|
||||
hosts_git_repositories: []
|
||||
|
||||
# packages to install/remove
|
||||
hosts_packages: []
|
||||
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: myos
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Description: System calls from https://github.com/aynicos/myos
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
# load system configs
|
||||
[ -r /etc/default/myos ] && . /etc/default/myos
|
||||
[ -r /etc/sysconfig/myos ] && . /etc/sysconfig/myos
|
||||
|
||||
# check system config
|
||||
[ -r ~/.env ] && . ~/.env || exit 1
|
||||
type make >/dev/null 2>&1 && [ -d "${MYOS}" ] || exit 2
|
||||
|
||||
case "$1" in
|
||||
*)
|
||||
IFS=$'\n'; exec env $(cat ~/.env 2>/dev/null) make -C "${MYOS}" $@
|
||||
esac
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
depend() {
|
||||
need localmount swap
|
||||
after bootmisc modules
|
||||
}
|
||||
|
||||
start() {
|
||||
/etc/init.d/myos start
|
||||
}
|
||||
|
||||
stop() {
|
||||
/etc/init.d/myos stop
|
||||
}
|
||||
|
||||
status() {
|
||||
/etc/init.d/myos status
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=System calls from https://github.com/aynicos/myos
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/init.d/myos start
|
||||
ExecStop=/etc/init.d/myos stop
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
- name: files - copy binary files
|
||||
with_items:
|
||||
- /etc/init.d/myos
|
||||
- /etc/init.d/zram
|
||||
copy: src=../files/{{item}} dest={{item}} owner=root group=root mode=0755
|
||||
become: yes
|
||||
@@ -18,6 +19,7 @@
|
||||
- name: files - systemd - copy files
|
||||
when: ansible_service_mgr|lower == "systemd"
|
||||
with_items:
|
||||
- /etc/systemd/system/myos.service
|
||||
- /etc/systemd/system/zram.service
|
||||
copy: src=../files/{{item}} dest={{item}} owner=root group=root mode=0644
|
||||
become: yes
|
||||
@@ -25,15 +27,8 @@
|
||||
- name: files - openrc - copy files
|
||||
when: ansible_service_mgr|lower == "openrc"
|
||||
with_items:
|
||||
- /etc/init.d/myos-openrc
|
||||
- /etc/init.d/zram-openrc
|
||||
- /etc/local.d/ansible.start
|
||||
copy: src=../files/{{item}} dest={{item}} owner=root group=root mode=0755
|
||||
become: yes
|
||||
|
||||
- name: files - get remote binary files
|
||||
with_items:
|
||||
- https://raw.githubusercontent.com/dylanaraps/pfetch/master/pfetch
|
||||
get_url: url={{item}} dest=/usr/local/bin owner=root group=root mode=0755
|
||||
ignore_errors: true
|
||||
become: yes
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
# file: tasks/git.yml
|
||||
|
||||
- name: git - clone repositories
|
||||
with_items: "{{ hosts_git_repositories|default([]) }}"
|
||||
git:
|
||||
repo: "{{ item.repo }}"
|
||||
dest: "{{ item.dest|default('/src') }}"
|
||||
key_file: "{{ item.key_file|default('~/.ssh/id_rsa') }}"
|
||||
version: "{{ item.version|default('HEAD') }}"
|
||||
ignore_errors: true
|
||||
become: yes
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
- import_tasks: files.yml
|
||||
tags:
|
||||
- files
|
||||
- import_tasks: git.yml
|
||||
tags:
|
||||
- git
|
||||
- import_tasks: groups.yml
|
||||
tags:
|
||||
- groups
|
||||
|
||||
@@ -3,13 +3,13 @@ SERVICE ?= cli
|
||||
-include .env
|
||||
|
||||
ansible:
|
||||
@make -C $(ANSIBLE_GIT_DIRECTORY) ansible-run-localhost $(foreach var,$(ENV_USER_VARS),$(if $($(var)),$(var)='$($(var))'))
|
||||
@make -C $(ANSIBLE_GIT_DIRECTORY) ansible-run-localhost
|
||||
|
||||
ansible-%:
|
||||
@make -C $(ANSIBLE_GIT_DIRECTORY) ansible-run-localhost $(foreach var,$(ENV_USER_VARS),$(if $($(var)),$(var)='$($(var))')) ANSIBLE_TAGS=$*
|
||||
@make -C $(ANSIBLE_GIT_DIRECTORY) ansible-run-localhost ANSIBLE_TAGS=$*
|
||||
|
||||
ansible-pull:
|
||||
@$(foreach var,$(ENV_USER_VARS),$(if $($(var)),$(var)='$($(var))')) $(if $(ANSIBLE_CONFIG),ANSIBLE_CONFIG=$(ANSIBLE_GIT_DIRECTORY)/$(ANSIBLE_CONFIG)) ansible-pull --url $(ANSIBLE_GIT_REPOSITORY) $(if $(ANSIBLE_GIT_KEY_FILE),--key-file $(ANSIBLE_GIT_KEY_FILE)) $(if $(ANSIBLE_GIT_VERSION),--checkout $(ANSIBLE_GIT_VERSION)) $(if $(ANSIBLE_GIT_DIRECTORY),--directory $(ANSIBLE_GIT_DIRECTORY)) $(if $(ANSIBLE_TAGS),--tags $(ANSIBLE_TAGS)) $(if $(ANSIBLE_EXTRA_VARS),--extra-vars '$(ANSIBLE_EXTRA_VARS)') $(if $(findstring true,$(FORCE)),--force) $(if $(findstring true,$(DRYRUN)),--check) --full $(if $(ANSIBLE_INVENTORY),--inventory $(ANSIBLE_INVENTORY)) $(ANSIBLE_VERBOSE) $(ANSIBLE_PLAYBOOK)
|
||||
@$(if $(ANSIBLE_CONFIG),ANSIBLE_CONFIG=$(ANSIBLE_GIT_DIRECTORY)/$(ANSIBLE_CONFIG)) ansible-pull --url $(ANSIBLE_GIT_REPOSITORY) $(if $(ANSIBLE_GIT_KEY_FILE),--key-file $(ANSIBLE_GIT_KEY_FILE)) $(if $(ANSIBLE_GIT_VERSION),--checkout $(ANSIBLE_GIT_VERSION)) $(if $(ANSIBLE_GIT_DIRECTORY),--directory $(ANSIBLE_GIT_DIRECTORY)) $(if $(ANSIBLE_TAGS),--tags $(ANSIBLE_TAGS)) $(if $(ANSIBLE_EXTRA_VARS),--extra-vars '$(ANSIBLE_EXTRA_VARS)') $(if $(findstring true,$(FORCE)),--force) $(if $(findstring true,$(DRYRUN)),--check) --full $(if $(ANSIBLE_INVENTORY),--inventory $(ANSIBLE_INVENTORY)) $(ANSIBLE_VERBOSE) $(ANSIBLE_PLAYBOOK)
|
||||
|
||||
exec:
|
||||
@make -C $(ANSIBLE_GIT_DIRECTORY) exec ARGS='$(ARGS)' DOCKER_NAME=$(COMPOSE_PROJECT_NAME)_$(SERVICE) ENV=$(ENV) DOCKER_RUN_WORKDIR=
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{% for var in hosts_user_env|default([]) %}
|
||||
{{var}}={{ lookup('env',var) }}
|
||||
{% endfor %}
|
||||
ENV_USER_VARS={{hosts_user_env |default([]) |join(' ')}}
|
||||
|
||||
Reference in New Issue
Block a user