Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Private mirrors2 #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ matrix:
dist: xenial
sudo: true
env: ANSIBLE_VERSION='ansible>=2.3,<2.4'
- os: linux
dist: bionic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I took a look on: https://docs.travis-ci.com/user/reference/overview/ - this OS, same as Debian are not supported by Travis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. This is heavily outdated CI. I saw their comment on adding Xenial support in 2017... And still none was done.

What is your suggestion here? Remove debian/xenial/bionic from tests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have any direct impact on that CI, except making issue/request to them. Best would be to remove them from tests, if they're just running default image, which is tested anyway.

sudo: true
env: ANSIBLE_VERSION='ansible>=2.3,<2.4'
- os: linux
dist: jessie
sudo: true
env: ANSIBLE_VERSION='ansible>=2.4,<2.5'
- os: linux
dist: stretch
sudo: true
env: ANSIBLE_VERSION='ansible>=2.4,<2.5'
- os: linux
dist: xenial
sudo: true
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,37 @@ F: Flag for remove clickhouse from host(disabled by default)
clickhouse_remove: no
```

Private mirror
--------------
To use a private APT mirror you need to define your own repository 'string' and
the repo key. Key may be provided as key name to download from a keyserver or
as armored GPG public key (the key itself). To use a key from a keyring,
variables `clickhouse_repo_key` and `clickhouse_repo_keyserver` should be provided.
To use a key in verbatim form, `clickhouse_repo_key_data` should be provided.
Custom mirror may be provided with `clickhouse_repo` variable.
Examples:
```
clickhouse_repo: 'deb http://apt.example.com/aptly/clickhouse xenial main'
clickhouse_repo_key: AABBCCDD
clickhouse_repo_keyserver: keyserver.example.com
```
or
```
clickhouse_repo: 'deb http://apt.example.com/aptly/clickhouse xenial main'
clickhouse_repo_key_data: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.12 (GNU/Linux)
mQANBFGspxsACADWgH5qqQtEa+Bjqd33X0PiRNcUf/Vt9m828uUuF5uRCEKruUG0
(few lines skipped)
LU/GfPzkCXlOt3Ud4L2EdvgQp/38VCNKmWi568soZnTwpjUt9AuN7iK3fm4=
=4dWC
-----END PGP PUBLIC KEY BLOCK-----
```

Please note, you need to create your mirror to be able to use it, and how to do
this is outside of the scope of this document. You may want to try to use reprepro
or aptly for this.

Example Playbook
----------------

Expand Down
25 changes: 23 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
---
# defaults file for clickhouse

#Flag for using with requirements check
clickhouse_supported: no
# List of distors supported by this playbook
clickhouse_supported_distros:
- 'Debian_jessie'
- 'Debian_stretch'
- 'Ubuntu_precise'
- 'Ubuntu_trusty'
- 'Ubuntu_xenial'
- 'Ubuntu_bionic'

# Settings for apt repo
clickhouse_repo: "deb http://repo.yandex.ru/clickhouse/deb/stable/ main/"
clickhouse_repo_old: "deb http://repo.yandex.ru/clickhouse/xenial stable main"
clickhouse_repo_keyserver: keyserver.ubuntu.com
clickhouse_repo_key: E0C56BD4
clickhouse_package:
- clickhouse-client
- clickhouse-server-base
- clickhouse-server-common
clickhouse_path_configdir: "/etc/clickhouse-server"
clickhouse_path_logdir: "/var/log/clickhouse-server"
clickhouse_path_data: "/var/lib/clickhouse/"
clickhouse_path_tmp: "/var/lib/clickhouse/tmp/"

#Type of installation (package,source)
clickhouse_setup: package
#Flag for remove clickhouse from host(disabled by default)
Expand Down
5 changes: 0 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---
# tasks file for clickhouse
- include_vars: "{{ item }}"
with_first_found:
- "../vars/{{ ansible_distribution }}_{{ ansible_distribution_release }}.yml"
- "../vars/empty.yml"
tags: [always]

- include: precheck.yml
tags: [precheck,install]
Expand Down
2 changes: 1 addition & 1 deletion tasks/precheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- name: Requirements check | Not supported distribution && release
fail:
msg: "Your distribution {{ ansible_distribution }}_{{ ansible_distribution_release }} not supported by this role,sorry."
when: clickhouse_supported|bool != True
when: ('{{ ansible_distribution }}_{{ ansible_distribution_release }}' not in clickhouse_supported_distros)

- name: Requirements check | Check if Clickhouse is installed
shell: dpkg-query -f '${Package} ' -W |grep -q "{{ clickhouse_package| join(" ")}}"
Expand Down
12 changes: 0 additions & 12 deletions vars/Debian_jessie.yml

This file was deleted.

12 changes: 0 additions & 12 deletions vars/Debian_stretch.yml

This file was deleted.

13 changes: 0 additions & 13 deletions vars/Ubuntu_trusty.yml

This file was deleted.

13 changes: 0 additions & 13 deletions vars/Ubuntu_xenial.yml

This file was deleted.