wip
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
---
|
||||
# file: tasks/config.yml
|
||||
|
||||
- name: config - arch != x86 - do not run docker-compose in docker
|
||||
when: ansible_machine|lower != "x86_64"
|
||||
lineinfile: dest="/etc/default/myos" state="present" line="DOCKER=false"
|
||||
become: yes
|
||||
|
||||
- name: config - set MYOS config in /etc/default/myos
|
||||
with_items:
|
||||
- MYOS={{ lookup('env','ANSIBLE_MYOS') }}
|
||||
lineinfile: dest="/etc/default/myos" create="yes" line="{{ item }}" mode="0644"
|
||||
become: yes
|
||||
|
||||
@@ -9,6 +9,13 @@
|
||||
copy: src=../files/{{item}} dest={{item}} owner=root group=root mode=0644
|
||||
become: yes
|
||||
|
||||
- name: files - copy myos cron file
|
||||
when: hosts_update
|
||||
with_items:
|
||||
- /etc/cron.d/myos
|
||||
copy: src=../files/{{item}} dest={{item}} owner=root group=root mode=0644
|
||||
become: yes
|
||||
|
||||
- name: files - copy binary files
|
||||
with_items:
|
||||
- /etc/init.d/myos
|
||||
@@ -19,6 +26,8 @@
|
||||
- name: files - systemd - copy files
|
||||
when: ansible_service_mgr|lower == "systemd"
|
||||
with_items:
|
||||
- /etc/systemd/system/ansible.service
|
||||
- /etc/systemd/system/ansible.timer
|
||||
- /etc/systemd/system/myos.service
|
||||
- /etc/systemd/system/zram.service
|
||||
copy: src=../files/{{item}} dest={{item}} owner=root group=root mode=0644
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
# file: tasks/git.yml
|
||||
|
||||
- name: git - clone repositories
|
||||
with_items: "{{ hosts_git_repositories|default([]) }}"
|
||||
git:
|
||||
repo: "{{ item.repo }}"
|
||||
dest: "{{ item.dest|default('/dns') }}"
|
||||
umask: "022"
|
||||
key_file: "{{ item.key_file|default('~/.ssh/id_rsa') }}"
|
||||
version: "{{ item.version|default('HEAD') }}"
|
||||
ignore_errors: true
|
||||
become: yes
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
- import_tasks: cloudinit.yml
|
||||
tags:
|
||||
- cloudinit
|
||||
- import_tasks: config.yml
|
||||
tags:
|
||||
- cloudinit
|
||||
- import_tasks: dir.yml
|
||||
tags:
|
||||
- dir
|
||||
@@ -25,6 +28,9 @@
|
||||
- import_tasks: services.yml
|
||||
tags:
|
||||
- services
|
||||
- import_tasks: git.yml
|
||||
tags:
|
||||
- git
|
||||
- import_tasks: ssh.yml
|
||||
tags:
|
||||
- ssh
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# file: tasks/services.yml
|
||||
|
||||
- name: services - enable/disable hosts services
|
||||
when: ansible_service_mgr|lower != "openrc"
|
||||
when: hosts_services is defined and ansible_service_mgr|lower != "openrc"
|
||||
with_items: "{{ hosts_services|default([]) }}"
|
||||
service:
|
||||
name: "{{item.name}}"
|
||||
@@ -11,7 +11,7 @@
|
||||
become: yes
|
||||
|
||||
- name: services - openrc - enable/disable hosts services
|
||||
when: ansible_service_mgr|lower == "openrc"
|
||||
when: hosts_services is defined and ansible_service_mgr|lower == "openrc"
|
||||
with_items: "{{ hosts_services|default([]) }}"
|
||||
service:
|
||||
name: "{{item.name}}"
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
copy: src="{{ item }}" dest=~/.ssh/ mode=0400
|
||||
ignore_errors: true
|
||||
|
||||
- name: user - create ~/.env
|
||||
- name: user - create ~/.myos
|
||||
template:
|
||||
src: env.j2
|
||||
dest: ~/.env
|
||||
src: myos.j2
|
||||
dest: ~/.myos
|
||||
force: no
|
||||
mode: 0400
|
||||
|
||||
@@ -32,13 +32,11 @@
|
||||
with_items: "{{ hosts_user_rc_functions|default([]) }}"
|
||||
file: path="~/.rc.d/{{item.path}}" state="{{item.state}}"
|
||||
|
||||
- name: user - copy ~/.*aliases ~/.*functions ~/.*profile ~/.shrc
|
||||
- name: user - copy ~/.*aliases ~/.*profile ~/.shrc
|
||||
with_items:
|
||||
- ".dircolors_aliases"
|
||||
- ".docker_aliases"
|
||||
- ".resty_aliases"
|
||||
- ".vim_aliases"
|
||||
- ".sh_functions"
|
||||
- ".bash_profile"
|
||||
- ".profile"
|
||||
- ".shrc"
|
||||
|
||||
Reference in New Issue
Block a user