Well, first push
This commit is contained in:
29
roles/import_ssh_key/.travis.yml
Normal file
29
roles/import_ssh_key/.travis.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
language: python
|
||||
python: "2.7"
|
||||
|
||||
# Use the new container infrastructure
|
||||
sudo: false
|
||||
|
||||
# Install ansible
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- python-pip
|
||||
|
||||
install:
|
||||
# Install ansible
|
||||
- pip install ansible
|
||||
|
||||
# Check ansible version
|
||||
- ansible --version
|
||||
|
||||
# Create ansible.cfg with correct roles_path
|
||||
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
||||
|
||||
script:
|
||||
# Basic role syntax check
|
||||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
2
roles/import_ssh_key/defaults/main.yml
Normal file
2
roles/import_ssh_key/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for import_ssh_key
|
||||
2
roles/import_ssh_key/handlers/main.yml
Normal file
2
roles/import_ssh_key/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for import_ssh_key
|
||||
17
roles/import_ssh_key/tasks/main.yml
Normal file
17
roles/import_ssh_key/tasks/main.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Dowload
|
||||
ansible.builtin.uri:
|
||||
url: https://github.com/MatousVondrejka.keys
|
||||
method: GET
|
||||
return_content: true
|
||||
register: ssh_key
|
||||
|
||||
- name: Setting
|
||||
ansible.builtin.blockinfile:
|
||||
state: present
|
||||
insertafter: EOF
|
||||
path: ~/.ssh/authorized_keys
|
||||
mode: '0664'
|
||||
create: true
|
||||
block: |
|
||||
{{ ssh_key.content }}
|
||||
2
roles/import_ssh_key/tests/inventory
Normal file
2
roles/import_ssh_key/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/import_ssh_key/tests/test.yml
Normal file
5
roles/import_ssh_key/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- import_ssh_key
|
||||
2
roles/import_ssh_key/vars/main.yml
Normal file
2
roles/import_ssh_key/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for import_ssh_key
|
||||
Reference in New Issue
Block a user