Compare commits
No commits in common. 'handler' and 'master' have entirely different histories.
@ -0,0 +1,12 @@ |
|||||||
|
--- |
||||||
|
- hosts: localhost |
||||||
|
tasks: |
||||||
|
|
||||||
|
- name: 'Call "id"' |
||||||
|
command: id |
||||||
|
|
||||||
|
- name: Copy a file |
||||||
|
copy: src=test.txt dest=/tmp/test.txt backup=yes |
||||||
|
|
||||||
|
- name: 'Call "cat /tmp/test.txt"' |
||||||
|
command: cat /tmp/test.txt |
||||||
@ -1,5 +0,0 @@ |
|||||||
--- |
|
||||||
- hosts: all |
|
||||||
roles: |
|
||||||
- dokuwiki_inventory |
|
||||||
|
|
||||||
@ -1,14 +0,0 @@ |
|||||||
--- |
|
||||||
- hosts: localhost |
|
||||||
tasks: |
|
||||||
- command: "grep {{ username }} /etc/passwd" |
|
||||||
register: result |
|
||||||
ignore_errors: True |
|
||||||
|
|
||||||
- debug: |
|
||||||
msg: '{{ username }} exists' |
|
||||||
when: result is success |
|
||||||
|
|
||||||
- debug: |
|
||||||
msg: '{{ username }} does not exist' |
|
||||||
when: result is failed |
|
||||||
@ -1,2 +1,7 @@ |
|||||||
|
ntp_servers: |
||||||
|
- 0.debian.pool.ntp.org |
||||||
|
- 1.debian.pool.ntp.org |
||||||
|
- 2.debian.pool.ntp.org |
||||||
|
|
||||||
ntp_package_name : ntp |
ntp_package_name : ntp |
||||||
ntp_service_name : ntp |
ntp_service_name : ntp |
||||||
|
|||||||
@ -1,2 +0,0 @@ |
|||||||
--- |
|
||||||
ssh_service_name: ssh |
|
||||||
@ -1,9 +0,0 @@ |
|||||||
--- |
|
||||||
- hosts: localhost |
|
||||||
tasks: |
|
||||||
- include: loop_include_sub.yml |
|
||||||
loop: |
|
||||||
- A |
|
||||||
- B |
|
||||||
loop_control: |
|
||||||
loop_var: outer |
|
||||||
@ -1,8 +0,0 @@ |
|||||||
--- |
|
||||||
- debug: "msg='{{ my_idx }} Innen: {{ item }}, Außen: {{ outer }}'" |
|
||||||
loop: |
|
||||||
- 1 |
|
||||||
- 2 |
|
||||||
loop_control: |
|
||||||
index_var: my_idx |
|
||||||
label: "Testytest" |
|
||||||
@ -1,7 +0,0 @@ |
|||||||
--- |
|
||||||
- hosts: all |
|
||||||
vars: |
|
||||||
monitored_by_ssh: True |
|
||||||
monitored_by_nrpe: True |
|
||||||
roles: |
|
||||||
- monitored |
|
||||||
@ -0,0 +1,29 @@ |
|||||||
|
--- |
||||||
|
- hosts: sysd |
||||||
|
|
||||||
|
tasks: |
||||||
|
|
||||||
|
- name: Install NTP |
||||||
|
package: |
||||||
|
name: "{{ ntp_package_name }}" |
||||||
|
state: latest |
||||||
|
|
||||||
|
- name: Template Config |
||||||
|
template: |
||||||
|
src: "{{ ntp_package_name }}.conf.j2" |
||||||
|
dest: "/etc/{{ ntp_package_name }}.conf" |
||||||
|
mode: 0644 |
||||||
|
owner: root |
||||||
|
group: root |
||||||
|
backup: yes |
||||||
|
|
||||||
|
- name: Restart Service |
||||||
|
service: |
||||||
|
name: "{{ ntp_service_name }}" |
||||||
|
state: restarted |
||||||
|
|
||||||
|
- name: Ensure Running |
||||||
|
service: |
||||||
|
name: "{{ ntp_service_name }}" |
||||||
|
state: started |
||||||
|
enabled: yes |
||||||
@ -1,4 +0,0 @@ |
|||||||
--- |
|
||||||
- hosts: sysd |
|
||||||
roles: |
|
||||||
- ntp |
|
||||||
@ -1,2 +0,0 @@ |
|||||||
--- |
|
||||||
doku_path: /var/lib/dokuwiki/data/pages/inventory |
|
||||||
@ -1,21 +0,0 @@ |
|||||||
--- |
|
||||||
- name: Create Inventory Folder |
|
||||||
local_action: |
|
||||||
module: file |
|
||||||
path: "{{ doku_path }}" |
|
||||||
state: directory |
|
||||||
mode: 0755 |
|
||||||
run_once: True |
|
||||||
|
|
||||||
- name: Write Wiki Page |
|
||||||
local_action: |
|
||||||
module: template |
|
||||||
src: host.j2 |
|
||||||
dest: "{{ doku_path }}/{{ inventory_hostname }}.txt" |
|
||||||
|
|
||||||
- name: Write Index Page |
|
||||||
local_action: |
|
||||||
module: template |
|
||||||
src: start.j2 |
|
||||||
dest: "{{ doku_path }}/start.txt" |
|
||||||
run_once: True |
|
||||||
@ -1,32 +0,0 @@ |
|||||||
====== {{ inventory_hostname }} ====== |
|
||||||
* FQDN: {{ ansible_fqdn }} -- {{ ansible_default_ipv4.address }} |
|
||||||
* Product: **{{ ansible_system_vendor|default("N/A") }}** {{ ansible_product_name|default("N/A") }} (S/N: {{ ansible_product_serial }}), {{ ansible_form_factor }} |
|
||||||
* Virtualization: {{ ansible_virtualization_role }} / {{ ansible_virtualization_type }} |
|
||||||
* CPUs: {{ ansible_processor_vcpus }} ( {{ ansible_processor_count }} x {{ ansible_processor_cores }} Cores x {{ ansible_processor_threads_per_core }} Threads ) |
|
||||||
* CPU-Type: {{ ansible_processor[2] }} |
|
||||||
* RAM: {{ ansible_memtotal_mb }} MB |
|
||||||
* Swap: {{ "%0.2f" % (ansible_swaptotal_mb / 1024) }} GB |
|
||||||
* OS: {{ ansible_distribution }} {{ ansible_distribution_version }} |
|
||||||
* Kernel: {{ ansible_kernel }} |
|
||||||
* Init: {{ ansible_service_mgr }} |
|
||||||
* IPs: |
|
||||||
* IPv4: {{ ansible_all_ipv4_addresses|join(', ') }} |
|
||||||
* IPv6: {{ ansible_all_ipv6_addresses|join(', ') }} |
|
||||||
|
|
||||||
|
|
||||||
Mountpoints: |
|
||||||
| Source | Mountpoint | Filesystem | |
|
||||||
{% for m in ansible_mounts %} |
|
||||||
| ''{{ m.device }}'' | ''{{ m.mount }}'' | ''{{ m.fstype }}'' | |
|
||||||
{% endfor %} |
|
||||||
|
|
||||||
* AppArmor: {{ ansible_apparmor.status }} |
|
||||||
* SE-Linux: {{ ansible_selinux.status }} |
|
||||||
* SSH-Host-Keys: |
|
||||||
* DSA: ''{{ ansible_ssh_host_key_dsa_public|default("N/A") }}'' |
|
||||||
* RSA: ''{{ ansible_ssh_host_key_rsa_public|default("N/A") }}'' |
|
||||||
* ECDSA: ''{{ ansible_ssh_host_key_ecdsa_public|default("N/A") }}'' |
|
||||||
* Ed25519: ''{{ ansible_ssh_host_key_ed25519_public|default("N/A") }}'' |
|
||||||
|
|
||||||
---- |
|
||||||
//{{ ansible_managed }}// |
|
||||||
@ -1,4 +0,0 @@ |
|||||||
{% for h in hostvars|sort %} |
|
||||||
* [[ {{ h }} ]] |
|
||||||
{% endfor %} |
|
||||||
|
|
||||||
@ -1 +0,0 @@ |
|||||||
Subproject commit c5d6c7fd84999febc117e5b97a78d63158d56912 |
|
||||||
@ -1,27 +0,0 @@ |
|||||||
--- |
|
||||||
- name: Detect domain name |
|
||||||
set_fact: |
|
||||||
domainname: "{{ ansible_dns.domain|default(False) or ansible_dns.search.0|default(False) or ansible_domain|default(False) or 'invalid'}}" |
|
||||||
|
|
||||||
- name: Add name/IP to hosts file |
|
||||||
lineinfile: |
|
||||||
dest: /etc/hosts |
|
||||||
regexp: '^{{ ansible_default_ipv4.address }}' |
|
||||||
line: '{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.{{ domainname }} {{ ansible_hostname }}' |
|
||||||
backup: yes |
|
||||||
|
|
||||||
- name: Clean/remove 127.0.1.1 |
|
||||||
lineinfile: |
|
||||||
dest: /etc/hosts |
|
||||||
regexp: '^127.0.1.1' |
|
||||||
state: absent |
|
||||||
backup: yes |
|
||||||
|
|
||||||
- name: Ensure 127.0.0.1 localhost |
|
||||||
lineinfile: |
|
||||||
dest: /etc/hosts |
|
||||||
regexp: '127.0.0.1' |
|
||||||
line: '127.0.0.1 localhost localhost.localdomain' |
|
||||||
insertbefore: BOF |
|
||||||
backup: yes |
|
||||||
|
|
||||||
@ -1 +0,0 @@ |
|||||||
Subproject commit 22b2fd3c3a5f631e4e5c2adb67798af91cedc550 |
|
||||||
@ -1,4 +0,0 @@ |
|||||||
ntp_servers: |
|
||||||
- 0.debian.pool.ntp.org |
|
||||||
- 1.debian.pool.ntp.org |
|
||||||
- 2.debian.pool.ntp.org |
|
||||||
@ -1,5 +0,0 @@ |
|||||||
--- |
|
||||||
- name: Restart NTP |
|
||||||
service: |
|
||||||
name: "{{ ntp_service_name }}" |
|
||||||
state: restarted |
|
||||||
@ -1,26 +0,0 @@ |
|||||||
--- |
|
||||||
- name: Install NTP |
|
||||||
package: |
|
||||||
name: "{{ ntp_package_name }}" |
|
||||||
state: latest |
|
||||||
|
|
||||||
- name: Template Config |
|
||||||
template: |
|
||||||
src: "etc/{{ ntp_package_name }}.conf.j2" |
|
||||||
dest: "/etc/{{ ntp_package_name }}.conf" |
|
||||||
mode: 0644 |
|
||||||
owner: root |
|
||||||
group: root |
|
||||||
backup: yes |
|
||||||
notify: Restart NTP |
|
||||||
|
|
||||||
- name: Restart Service |
|
||||||
service: |
|
||||||
name: "{{ ntp_service_name }}" |
|
||||||
state: restarted |
|
||||||
|
|
||||||
- name: Ensure Running |
|
||||||
service: |
|
||||||
name: "{{ ntp_service_name }}" |
|
||||||
state: started |
|
||||||
enabled: yes |
|
||||||
@ -1,2 +0,0 @@ |
|||||||
--- |
|
||||||
ssh_service_name: sshd |
|
||||||
@ -1,18 +0,0 @@ |
|||||||
--- |
|
||||||
- name: "Set «PermitRootLogin» to «without-password»" |
|
||||||
lineinfile: |
|
||||||
dest: /etc/ssh/sshd_config |
|
||||||
regexp: '^#? *PermitRootLogin' |
|
||||||
line: "PermitRootLogin without-password" |
|
||||||
backup: yes |
|
||||||
register: sshconfigchanged |
|
||||||
|
|
||||||
|
|
||||||
- name: Restart sshd |
|
||||||
service: |
|
||||||
name: "{{ ssh_service_name }}" |
|
||||||
state: restarted |
|
||||||
sleep: 5 |
|
||||||
when: sshconfigchanged is changed |
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in new issue