Skip to content

Commit 4a397b8

Browse files
authored
Merge pull request #9 from queeno/revamp_ansible_uchiwa
Revamp repository with latest updates
2 parents e42ce78 + d916002 commit 4a397b8

File tree

13 files changed

+31
-36
lines changed

13 files changed

+31
-36
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/.vagrant/
22
*.swp
3+
.idea/
4+
*.log

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
language: python
3-
python: "2.7"
3+
python: "3.7"
44

55
before_install:
66
- sudo apt-get update -qq
77

88
install:
99
# Install Ansible.
10-
- pip install ansible==1.9.2
10+
- pip3 install ansible==2.9.3
1111

1212
# Create an inventory file for testing.
1313
- "echo 'uchiwa-standalone ansible_ssh_host=localhost' > inventory"
@@ -17,4 +17,4 @@ script:
1717
- "ansible-playbook -i inventory vagrant/site.yml --syntax-check"
1818

1919
# Run the playbook
20-
- "ansible-playbook -vvvv -i inventory vagrant/site.yml --connection=local --sudo"
20+
- "ansible-playbook -vvvv -i inventory vagrant/site.yml --connection=local"

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ These variables are defined in `defaults/main.yml`. Please overwrite if you have
3737
|-----------------------------|-----------------|----------------------------------------------|--------------------------------|
3838
|`supported_os_families` |List of strings |Supported OS families by the role |['Debian','RedHat'] |
3939
|`install_repo` |Boolean |Determines whether to install sensu repo |True |
40-
|`sensu_apt_repo_url` |String |Sensu APT repository URL |'http://repos.sensuapp.org/apt' |
41-
|`sensu_apt_repo_distribution`|String |Sensu APT repository distribution |'sensu' |
40+
|`sensu_apt_repo_url` |String |Sensu APT repository URL |'https://sensu.global.ssl.fastly.net/apt' |
41+
|`sensu_apt_repo_distribution`|String |Sensu APT repository distribution |'{{ ansible_distribution_release }}' |
4242
|`sensu_apt_repo` |String |Sensu APT repository name |'main' |
4343
|`sensu_apt_repo_key_url` |String |Sensu APT repository key URL |Please see <sup>1</sup>|
44-
|`sensu_apt_repo_key_id` |String |Sensu APT repository key ID |'7580C77F' |
44+
|`sensu_apt_repo_key_id` |String |Sensu APT repository key ID |'EB9C94BB' |
4545
|`sensu_yum_repo` |String |Determines which YUM sensu repo to install <sup>2</sup> |'sensu' |
4646
|`version` |String |Determines the uchiwa version to install <sup>3</sup> |'installed' |
4747
|`uchiwa_apt_pkg` |String |The uchiwa package name for Debian systems |'uchiwa' |
@@ -132,8 +132,8 @@ The `vagrant up` command will trigger a `standalone.yml` ansible-playbook run th
132132

133133
You can also spin up a specific vm:
134134

135-
`vagrant up debian` spins up *hashicorp/precise64*
136-
`vagrant up redhat` spins up *chef/centos-6.5*
135+
`vagrant up debian` spins up *ubuntu/xenial64*
136+
`vagrant up redhat` spins up *bento/centos-8*
137137

138138
### Acceptance Tests
139139

Vagrantfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
machines = {
22
'debian' => {
33
'ip' => '192.168.33.2',
4-
'box' => 'ubuntu/trusty64',
4+
'box' => 'ubuntu/xenial64',
55
'local_port' => '8080',
66
},
77
'redhat' => {
88
'ip' => '192.168.33.3',
9-
'box' => 'bento/centos-7.1',
9+
'box' => 'bento/centos-8',
1010
'local_port' => '8081',
1111
}
1212
}
@@ -26,7 +26,6 @@ Vagrant.configure('2') do |config|
2626
'redhat' => ['redhat-standalone']
2727
}
2828
ansible.limit = "#{vm}"
29-
ansible.sudo = true
3029
ansible.host_key_checking = false
3130
end
3231
end

defaults/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ supported_os_families:
1010
install_repo: true
1111

1212
# The sensu APT repo params
13-
sensu_apt_repo_url: 'http://repositories.sensuapp.org/apt'
14-
sensu_apt_repo_distribution: sensu
13+
sensu_apt_repo_url: 'https://sensu.global.ssl.fastly.net/apt'
14+
sensu_apt_repo_distribution: "{{ ansible_distribution_release }}"
1515
sensu_apt_repo: main
16-
sensu_apt_repo_key_url: 'http://repositories.sensuapp.org/apt/pubkey.gpg'
16+
sensu_apt_repo_key_url: 'https://sensu.global.ssl.fastly.net/apt/pubkey.gpg'
1717
sensu_apt_repo_key_id: EB9C94BB
1818

1919
# The sensu YUM repo params

files/sensu-unstable.repo

-5
This file was deleted.

files/sensu.repo

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[sensu]
2-
name=sensu-main
3-
baseurl=http://repositories.sensuapp.org/yum/$releasever/$basearch/
2+
name=sensu
3+
baseurl=https://sensu.global.ssl.fastly.net/yum/7/$basearch/
44
gpgcheck=0
5-
enabled=1
5+
enabled=1

handlers/main.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
---
33

44
- name: restart uchiwa
5-
service: name=uchiwa state=restarted
5+
systemd:
6+
state: restarted
7+
name: uchiwa

meta/main.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ galaxy_info:
5858
# - maverick
5959
# - natty
6060
# - oneiric
61-
- precise
62-
- quantal
63-
- raring
64-
- saucy
65-
- trusty
61+
- xenial
6662
#- name: SLES
6763
# versions:
6864
# - all
@@ -82,8 +78,8 @@ galaxy_info:
8278
# - etch
8379
# - lenny
8480
# - squeeze
85-
- wheezy
86-
- jessie
81+
- buster
82+
8783
#
8884
# Below are all categories currently available. Just as with
8985
# the platforms above, uncomment those that apply to your role.

tasks/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
# Install sensu/uchiwa repo
1010
- name: Install sensu apt repo
11-
include: repo/apt.yml
11+
import_tasks: repo/apt.yml
1212
when: install_repo and ansible_os_family == 'Debian'
1313

14-
- include: repo/yum.yml
14+
- import_tasks: repo/yum.yml
1515
when: install_repo and ansible_os_family == 'RedHat'
1616

1717
# Install uchiwa
18-
- include: install.yml
18+
- import_tasks: install.yml
1919

2020
# Configure uchiwa
21-
- include: config.yml
21+
- import_tasks: config.yml

tasks/repo/yum.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
- include: ../redhat/selinux.yml
3+
- import_tasks: ../redhat/selinux.yml
44
when: not ansible_selinux
55

66
- name: Add the official sensu repository

vagrant/site.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
- include: standalone.yml
2+
- import_playbook: standalone.yml

vagrant/standalone.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Default playbook to install uchiwa on vanilla box
22

33
- hosts: all
4+
become: true
45
roles:
56
- role: uchiwa
67

0 commit comments

Comments
 (0)