Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint errors, fix checkmode #23

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ galaxy_info:
license: MIT
min_ansible_version: 2.4
platforms:
- name: Fedora
versions: [ 27, 28 ]
- name: EL
versions: [ 6, 7 ]
- name: Fedora
versions: [ 27, 28 ]
- name: EL
versions: [ 6, 7 ]
7 changes: 4 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
state: present

- name: Find out reserved memory for the crash kernel
command: cat /sys/kernel/kexec_crash_size
slurp:
src: /sys/kernel/kexec_crash_size
register: kexec_crash_size

- include_tasks: ssh.yml
Expand All @@ -18,13 +19,13 @@
src: kdump.conf.j2
dest: /etc/kdump.conf
backup: yes
when: kexec_crash_size.stdout|int > 0
when: kexec_crash_size.content|b64decode|int > 0
notify: restart kdump

- name: Generate /etc/sysconfig/kdump
template:
src: kdump.j2
dest: /etc/sysconfig/kdump
backup: yes
when: kexec_crash_size.stdout|int > 0
when: kexec_crash_size.content|b64decode|int > 0
notify: restart kdump
17 changes: 10 additions & 7 deletions tasks/ssh.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
---
- stat: path="{{ kdump_sshkey }}"
- name: Check whether key exists
stat: path="{{ kdump_sshkey }}"
register: sshkey_stats
vcrhonek marked this conversation as resolved.
Show resolved Hide resolved

- command: "/usr/bin/ssh-keygen -t rsa -f {{ kdump_sshkey }} -N '' "
when: sshkey_stats.stat.exists == False
- name: Create key
command: "/usr/bin/ssh-keygen -t rsa -f {{ kdump_sshkey }} -N '' "
when: not sshkey_stats.stat.exists

- name: cat file to register
shell: cat {{ kdump_sshkey }}.pub
- name: Fetch key
slurp:
src: "{{ kdump_sshkey }}.pub"
register: keydata

- name:
- name: Add key to authorized keys
authorized_key:
user: "{{ kdump_ssh_user }}"
key: "{{ keydata.stdout }}"
key: "{{ keydata.content|b64decode }}"
state: present
delegate_to: "{{ kdump_ssh_server }}"