Skip to content

Commit

Permalink
Improve task name
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdewit committed Dec 28, 2017
1 parent cebbfb3 commit e369c7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
- name: Restart services
- name: Restart service
service: name=autossh.{{ autossh_name }} state=restarted
become: yes
18 changes: 9 additions & 9 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
- name: Install autossh
package: name=autossh state=latest
become: yes
notify: Restart services
- name: Create user
notify: Restart service
- name: Create user with {{ autossh_name }} key
user:
name: autossh
shell: /sbin/nologin
generate_ssh_key: yes
ssh_key_file: .ssh/{{ autossh_name }}
become: yes
register: create_user_result
- name: Export public key
- name: Export public key for {{ autossh_name }}
set_fact:
autossh_public_keys: >-
{{
autossh_public_keys |
default({}) |
combine({autossh_name: create_user_result.ssh_public_key})
}}
- name: Add host key
- name: Add {{ autossh_name }} host key
known_hosts:
name: "[{{ autossh_host }}]:{{ autossh_port }}"
key: "{{ autossh_hostkey }}"
Expand All @@ -31,19 +31,19 @@
dest: /etc/init.d/autossh
mode: 0755
become: yes
notify: Restart services
- name: Configure services
notify: Restart service
- name: Configure {{ autossh_name }} service
template:
src: configuration.j2
dest: /etc/conf.d/autossh.{{ autossh_name }}
become: yes
notify: Restart services
- name: Link to initscript
notify: Restart service
- name: Link to {{ autossh_name }} initscript
file:
state: link
path: /etc/init.d/autossh.{{ autossh_name }}
src: /etc/init.d/autossh
become: yes
- name: Start services
- name: Start {{ autossh_name }} service
service: name=autossh.{{ autossh_name }} enabled=yes state=started
become: yes

0 comments on commit e369c7c

Please sign in to comment.