adds base playbook and updates README
This commit is contained in:
parent
9b15a71be5
commit
35ece6c9ce
3 changed files with 26 additions and 2 deletions
|
@ -36,7 +36,12 @@ This will plan and run the job file without the need for you to copy and paste t
|
|||
|
||||
Ansible can be used to provision a new host, connect a host to the cluster, run new jobs and more.
|
||||
|
||||
In order to use ansible from your local machine, you must have access to the admin vpn. This will allow you direct connection to each of the hosts.
|
||||
Install ansible from [here](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
|
||||
|
||||
Change the `ansible/hosts.sample` file to your local username before you run any of these playbooks. Your local user should have an SSH key in its home dir, which can be configured with the `ssh` playbook.
|
||||
In order to use ansible from your local machine, you must have access to the admin VPN. This will allow you direct connection to each of the hosts.
|
||||
|
||||
Move the `ansible/group_vars/all.yml.sample` file to `ansible/group_vars/all.yml` and change your local username before you run any of these playbooks. Your local user should have an SSH key in its home dir, which can be configured with the `ssh` playbook.
|
||||
|
||||
```bash
|
||||
$ ansible-playbook -i hosts redbrick-ansible.yml
|
||||
```
|
||||
|
|
8
ansible/redbrick-ansible.yml
Normal file
8
ansible/redbrick-ansible.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
|
||||
- name: Redbrick Nomad, Consul and general management
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
roles:
|
||||
- { role: apt } # update all packages, equivalent to `apt update && apt upgrade`
|
||||
- { role: ssh } # add users defined in roles/defaults/main.yml
|
|
@ -3,8 +3,19 @@
|
|||
become: true
|
||||
apt:
|
||||
upgrade: yes
|
||||
autoclean: yes
|
||||
autoremove: yes
|
||||
update_cache: yes
|
||||
when: ansible_os_family == "Debian" and apt_update_packages
|
||||
register: result
|
||||
|
||||
- name: List installed and updated packages
|
||||
shell:
|
||||
cmd: 'grep -E "^$(date +%Y-%m-%d).+ (install|upgrade) " /var/log/dpkg.log | cut -d " " -f 3-5'
|
||||
register: result
|
||||
|
||||
- name: Show Output
|
||||
debug: msg= '{{ result.stdout_lines }}'
|
||||
|
||||
- name: install common tools
|
||||
ansible.builtin.apt:
|
||||
|
|
Loading…
Reference in a new issue