Quellcode durchsuchen

role rewritten

master
Ursprung
Commit
dbf2fe00c9
13 geänderte Dateien mit 84 neuen und 48 gelöschten Zeilen
  1. +3
    -0
      defaults/main.yaml
  2. +1
    -1
      tasks/ansible.yaml
  3. +3
    -3
      tasks/ara.yaml
  4. +29
    -0
      tasks/cleanup.yaml
  5. +11
    -0
      tasks/config.yaml
  6. +0
    -14
      tasks/connection_plugin_lxc_ssh.yml
  7. +18
    -0
      tasks/main.yaml
  8. +0
    -23
      tasks/main.yml
  9. +11
    -0
      tasks/mitogen.yaml
  10. +0
    -0
      tasks/ovh_module.yaml
  11. +0
    -1
      tasks/roles.yml
  12. +0
    -5
      tasks/setup_Debian.yaml
  13. +8
    -1
      templates/ansible.cfg.j2

+ 3
- 0
defaults/main.yaml Datei anzeigen

@@ -0,0 +1,3 @@
ansible_use_ara: false
ansible_use_mitogen: true
ansible_with_ovh_module: true

+ 1
- 1
tasks/ansible.yaml Datei anzeigen

@@ -1,6 +1,6 @@
---

- name: install ansible via pip
- name: ansible pip package
pip:
name: ansible
state: latest

tasks/ara.yml → tasks/ara.yaml Datei anzeigen

@@ -1,11 +1,11 @@
---

- name: Install ARA with pip
- name: ara pip package
pip:
name: ara
state: present

- name: Get ARA's installed location
- name: get ara location
shell: python -c "import os,ara; print(os.path.dirname(ara.__file__))"
register: ara_location
register: _ara_location
changed_when: false

+ 29
- 0
tasks/cleanup.yaml Datei anzeigen

@@ -0,0 +1,29 @@
---

- name: cleanup debian ansible package
apt:
pkg: ansible
state: absent

- name: cleanup ansible lxc_ssh plugin
file:
path: /usr/share/ansible/plugins/connection/lxc_ssh
state: absent

- name: cleanup ansible ovh module
file:
path: /usr/share/ansible/modules/ovh
state: absent
when: not ansible_with_ovh_module

- name: cleanup ara pip package
pip:
name: ara
state: absent
when: not ansible_use_ara

- name: cleanup mitogen pip package
pip:
name: mitogen
state: absent
when: not ansible_use_mitogen

+ 11
- 0
tasks/config.yaml Datei anzeigen

@@ -0,0 +1,11 @@
---

- name: ansible etc directory
file:
path: /etc/ansible
state: directory

- name: ansible config
template:
src: ansible.cfg.j2
dest: /etc/ansible/ansible.cfg

+ 0
- 14
tasks/connection_plugin_lxc_ssh.yml Datei anzeigen

@@ -1,14 +0,0 @@
---

- name: connection plugin directory
file:
path: /usr/share/ansible/plugins/connection
state: directory

- name: clone ansible-lxc-ssh
git:
#repo: https://github.com/chifflier/ansible-lxc-ssh.git # this wirks for ansible 2.2 with depecration warnings
#repo: https://github.com/andreasscherbaum/ansible-lxc-ssh.git # this wirks for ansible 2.2 without warnings but not for anisble 2.4
repo: https://github.com/lgeorget/ansible-lxc-ssh.git # this works for ansible 2.4
dest: /usr/share/ansible/plugins/connection/lxc_ssh
version: master

+ 18
- 0
tasks/main.yaml Datei anzeigen

@@ -0,0 +1,18 @@
---

- include_tasks: setup_Debian.yaml

- include_tasks: ansible.yaml

- include_tasks: mitogen.yaml
when: ansible_use_mitogen

- include_tasks: ara.yaml
when: ansible_use_ara

- include_tasks: ovh_module.yaml
when: ansible_with_ovh_module

- import_tasks: config.yaml

- import_tasks: cleanup.yaml

+ 0
- 23
tasks/main.yml Datei anzeigen

@@ -1,23 +0,0 @@
---

- include_tasks: setup_Debian.yml

- include_tasks: ansible.yaml


- include_tasks: connection_plugin_lxc_ssh.yml
#- include_tasks: ara.yml

- include_tasks: ovh_module.yml

- name: ansible etc directory
file:
path: /etc/ansible
state: directory

- name: ansible config
template:
src: ansible.cfg.j2
dest: /etc/ansible/ansible.cfg

- include_tasks: roles.yml

+ 11
- 0
tasks/mitogen.yaml Datei anzeigen

@@ -0,0 +1,11 @@
---

- name: mitogen pip package
pip:
name: mitogen
state: latest

- name: get ansible_mitogen location
shell: python -c "import os,ansible_mitogen; print(os.path.dirname(ansible_mitogen.__file__))"
register: _ansible_mitogen_location
changed_when: false

tasks/ovh_module.yml → tasks/ovh_module.yaml Datei anzeigen


+ 0
- 1
tasks/roles.yml Datei anzeigen

@@ -1 +0,0 @@
---

tasks/setup_Debian.yml → tasks/setup_Debian.yaml Datei anzeigen

@@ -20,8 +20,3 @@
#- which
- python-libcloud
- python-netaddr

- name: uninstall debian ansible module
apt:
pkg: ansible
state: absent

+ 8
- 1
templates/ansible.cfg.j2 Datei anzeigen

@@ -4,9 +4,16 @@ stdout_callback = yaml

library = /usr/share/ansible/modules

{% if ansible_use_mitogen %}
strategy_plugins = {{ _ansible_mitogen_location.stdout }}/plugins/strategy
strategy = mitogen_linear
{% endif %}

retry_files_enabled = False

#callback_plugins = {#{{ ara_location.stdout }}#}/plugins/callbacks
{% if ansible_use_ara %}
callback_plugins = {{ _ara_location.stdout }}/plugins/callbacks
{% endif %}

[ssh_connection]
ssh_args = -o CheckHostIP=no -o StrictHostKeyChecking=yes


Laden…
Abbrechen
Speichern