Skip to content

Commit

Permalink
Merge pull request #27 from christopherobin/repo/docker
Browse files Browse the repository at this point in the history
Added docker repo for CentOS 7, fixed tasks to stop spewing errors on Ansible 2.x
  • Loading branch information
MiLk authored Dec 6, 2016
2 parents 2272273 + a57fbda commit a31a4bc
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 15 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ name |
[`jenkins`](http://jenkins-ci.org/) | `jenkins`
[`mesophere`](https://www.mesosphere.com/) | `mesosphere`
[`mongodb`](http://mongodb.org/) | `mongodb`
[`mysql`](https://www.mysql.fr/products/community/) | `mysql56-community` `mysql-connectors-community` `mysql-tools-community`
[`mysql`](https://www.mysql.fr/products/community/) | `mysql56-community` `mysql-connectors-community` `mysql-tools-community`
[`nginx`](http://nginx.org/) | `nginx`
[`percona`](https://www.percona.com) | `percona-release-x86_64`
[`postgresql 9.0`](http://yum.postgresql.org/repopackages.php) | `pgdg90`
Expand All @@ -97,6 +97,7 @@ become available.
name | provides
------------------------------------------------------------------------------|-----------------------------------------------
[`couchbase`](http://www.couchbase.com/) | `couchbase`
[`docker`](https://www.docker.com/) | `dockerrepo`
[`elasticsearch`](https://www.elastic.co/products/elasticsearch) | `elasticsearch-2.x`
[`endpoint`](https://packages.endpoint.com/) | `endpoint`
[`epel`](https://fedoraproject.org/wiki/EPEL) | `epel`
Expand Down Expand Up @@ -133,6 +134,7 @@ name |
name | provides
------------------------------------------------------------------------------|-----------------------------------------------
[`backports`](https://packages.debian.org/wheezy-backports/) | `backports`
[`docker`](https://www.docker.com/) | `docker`
[`dotdeb`](https://www.dotdeb.org) | `dotdeb`
[`elasticsearch`](https://www.elastic.co/products/elasticsearch) | `elasticsearch-2.x`
[`jenkins`](http://jenkins-ci.org/) | `jenkins`
Expand All @@ -150,6 +152,7 @@ _nb:_ `deb-src` is not provided. `deb` is only provided.
name | provides
------------------------------------------------------------------------------|-----------------------------------------------
[`backports`](https://packages.debian.org/jessie-backports/) | `backports`
[`docker`](https://www.docker.com/) | `docker`
[`dotdeb`](https://www.dotdeb.org) | `dotdeb`
[`elasticsearch`](https://www.elastic.co/products/elasticsearch) | `elasticsearch-2.x`
[`jenkins`](http://jenkins-ci.org/) | `jenkins`
Expand Down
63 changes: 63 additions & 0 deletions files/debian/keys/docker.gpg
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFWln24BEADrBl5p99uKh8+rpvqJ48u4eTtjeXAWbslJotmC/CakbNSqOb9o
ddfzRvGVeJVERt/Q/mlvEqgnyTQy+e6oEYN2Y2kqXceUhXagThnqCoxcEJ3+KM4R
mYdoe/BJ/J/6rHOjq7Omk24z2qB3RU1uAv57iY5VGw5p45uZB4C4pNNsBJXoCvPn
TGAs/7IrekFZDDgVraPx/hdiwopQ8NltSfZCyu/jPpWFK28TR8yfVlzYFwibj5WK
dHM7ZTqlA1tHIG+agyPf3Rae0jPMsHR6q+arXVwMccyOi+ULU0z8mHUJ3iEMIrpT
X+80KaN/ZjibfsBOCjcfiJSB/acn4nxQQgNZigna32velafhQivsNREFeJpzENiG
HOoyC6qVeOgKrRiKxzymj0FIMLru/iFF5pSWcBQB7PYlt8J0G80lAcPr6VCiN+4c
NKv03SdvA69dCOj79PuO9IIvQsJXsSq96HB+TeEmmL+xSdpGtGdCJHHM1fDeCqkZ
hT+RtBGQL2SEdWjxbF43oQopocT8cHvyX6Zaltn0svoGs+wX3Z/H6/8P5anog43U
65c0A+64Jj00rNDr8j31izhtQMRo892kGeQAaaxg4Pz6HnS7hRC+cOMHUU4HA7iM
zHrouAdYeTZeZEQOA7SxtCME9ZnGwe2grxPXh/U/80WJGkzLFNcTKdv+rwARAQAB
tDdEb2NrZXIgUmVsZWFzZSBUb29sIChyZWxlYXNlZG9ja2VyKSA8ZG9ja2VyQGRv
Y2tlci5jb20+iQIcBBABCgAGBQJWw7vdAAoJEFyzYeVS+w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UAJO8u46eiQI4BBMBAgAiBQJVpZ9uAhsvBgsJCAcDAgYVCAIJCgsEFgID
AQIeAQIXgAAKCRD3YiFXLFJgnbRfEAC9Uai7Rv20QIDlDogRzd+Vebg4ahyoUdj0
CH+nAk40RIoq6G26u1e+sdgjpCa8jF6vrx+smpgd1HeJdmpahUX0XN3X9f9qU9oj
9A4I1WDalRWJh+tP5WNv2ySy6AwcP9QnjuBMRTnTK27pk1sEMg9oJHK5p+ts8hlS
C4SluyMKH5NMVy9c+A9yqq9NF6M6d6/ehKfBFFLG9BX+XLBATvf1ZemGVHQusCQe
bTGv0C0V9yqtdPdRWVIEhHxyNHATaVYOafTj/EF0lDxLl6zDT6trRV5n9F1VCEh4
Aal8L5MxVPcIZVO7NHT2EkQgn8CvWjV3oKl2GopZF8V4XdJRl90U/WDv/6cmfI08
GkzDYBHhS8ULWRFwGKobsSTyIvnbk4NtKdnTGyTJCQ8+6i52s+C54PiNgfj2ieNn
6oOR7d+bNCcG1CdOYY+ZXVOcsjl73UYvtJrO0Rl/NpYERkZ5d/tzw4jZ6FCXgggA
/Zxcjk6Y1ZvIm8Mt8wLRFH9Nww+FVsCtaCXJLP8DlJLASMD9rl5QS9Ku3u7ZNrr5
HWXPHXITX660jglyshch6CWeiUATqjIAzkEQom/kEnOrvJAtkypRJ59vYQOedZ1s
FVELMXg2UCkD/FwojfnVtjzYaTCeGwFQeqzHmM241iuOmBYPeyTY5veF49aBJA1g
EJOQTvBR8Q==
=Yhur
-----END PGP PUBLIC KEY BLOCK-----
8 changes: 4 additions & 4 deletions tasks/amazon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
group=root
mode=0644
when: "item['name']|default(item) in repository_list and 'amazon' in repository_list[item['name']|default(item)]"
with_items: repositories['amazon']|default([])
with_items: "{{ repositories['amazon']|default([]) }}"
tags:
- files
- repos
Expand All @@ -20,7 +20,7 @@
group=root
mode=0644
when: "item['name']|default(item) in repository_list and 'amazon' in repository_list[item['name']|default(item)] and 'key' in repository_list[item['name']|default(item)]['amazon']"
with_items: repositories['amazon']|default([])
with_items: "{{ repositories['amazon']|default([]) }}"
tags:
- files
- repos
Expand All @@ -33,7 +33,7 @@
group=root
mode=0644
when: "'amazon' in remote_repositories and item.endswith('repo')"
with_items: remote_repositories['amazon']|default([])
with_items: "{{ remote_repositories['amazon']|default([]) }}"
tags:
- files
- repos
Expand All @@ -43,7 +43,7 @@
name="{{item}}"
state="present"
when: "'amazon' in remote_repositories and item.endswith('rpm')"
with_items: remote_repositories['amazon']|default([])
with_items: "{{ remote_repositories['amazon']|default([]) }}"
tags:
- files
- repos
12 changes: 6 additions & 6 deletions tasks/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
group=root
mode=0644
when: "item['name']|default(item) in repository_list and centos_distribution in repository_list[item['name']|default(item)] and repository_list[item['name']|default(item)][centos_distribution]['repo'] is defined"
with_items: repositories[centos_distribution]|default([])
with_items: "{{ repositories[centos_distribution]|default([]) }}"
tags:
- files
- repos
Expand All @@ -20,7 +20,7 @@
group=root
mode=0644
when: "item['name']|default(item) in repository_list and centos_distribution in repository_list[item['name']|default(item)] and 'key' in repository_list[item['name']|default(item)][centos_distribution]"
with_items: repositories[centos_distribution]|default([])
with_items: "{{ repositories[centos_distribution]|default([]) }}"
tags:
- files
- repos
Expand All @@ -30,15 +30,15 @@
name="{{ repository_list[item['name']|default(item)][centos_distribution]['url'] }}"
state=present
when: "item['name']|default(item) in repository_list and repository_list[item['name']|default(item)][centos_distribution]['url'] is defined and repository_list[item['name']|default(item)][centos_distribution]['url'].endswith('rpm')"
with_items: repositories[centos_distribution]|default([])
with_items: "{{ repositories[centos_distribution]|default([]) }}"
tags:
- files
- repos

- name: "Ensure repositories from defined rpms are disabled by default, unless specified to be enabled."
command: "yum-config-manager --disable {{ item }}"
when: "item['name']|default(item) in repository_list and repository_list[item['name']|default(item)][centos_distribution]['url'] is defined and repository_list[item['name']|default(item)][centos_distribution]['url'].endswith('rpm')"
with_items: repositories[centos_distribution]|default([])
with_items: "{{ repositories[centos_distribution]|default([]) }}"
tags:
- files
- repos
Expand All @@ -51,7 +51,7 @@
group=root
mode=0644
when: centos_distribution in remote_repositories and item.endswith('repo')
with_items: remote_repositories[centos_distribution]|default([])
with_items: "{{ remote_repositories[centos_distribution]|default([]) }}"
tags:
- files
- repos
Expand All @@ -61,7 +61,7 @@
name="{{item}}"
state="present"
when: centos_distribution in remote_repositories and item.endswith('rpm')
with_items: remote_repositories[centos_distribution]|default([])
with_items: "{{ remote_repositories[centos_distribution]|default([]) }}"
tags:
- files
- repos
16 changes: 12 additions & 4 deletions tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
group=root
mode=0644
when: "item['name']|default(item) in repository_list and debian_distribution in repository_list[item['name']|default(item)] and repository_list[item][debian_distribution]['key'] is defined"
with_items: repositories[debian_distribution]|default([])
with_items: "{{ repositories[debian_distribution]|default([]) }}"
tags:
- files
- repos
Expand All @@ -16,7 +16,7 @@
apt_key: >
file="/tmp/{{ repository_list[item][debian_distribution]['key'] }}"
when: "item['name']|default(item) in repository_list and debian_distribution in repository_list[item['name']|default(item)] and repository_list[item][debian_distribution]['key'] is defined"
with_items: repositories[debian_distribution]|default([])
with_items: "{{ repositories[debian_distribution]|default([]) }}"
tags:
- files
- repos
Expand All @@ -26,7 +26,15 @@
path="/tmp/{{ repository_list[item][debian_distribution]['key'] }}"
state=absent
when: "item['name']|default(item) in repository_list and debian_distribution in repository_list[item['name']|default(item)] and repository_list[item][debian_distribution]['key'] is defined"
with_items: repositories[debian_distribution]|default([])
with_items: "{{ repositories[debian_distribution]|default([]) }}"
tags:
- files
- repos

- name: "Check that we have the proper apt transports"
apt: pkg=apt-transport-https state=present update_cache=yes
when: "item['name']|default(item) in repository_list and debian_distribution in repository_list[item['name']|default(item)] and repository_list[item][debian_distribution]['url']|match('https.*')"
with_items: "{{ repositories[debian_distribution]|default([]) }}"
tags:
- files
- repos
Expand All @@ -37,7 +45,7 @@
repo="deb {{ repository_list[item][debian_distribution]['url'] }} {{ repository_list[item][debian_distribution]['pool'] }}"
update_cache=no
when: "item['name']|default(item) in repository_list and debian_distribution in repository_list[item['name']|default(item)]"
with_items: repositories[debian_distribution]|default([])
with_items: "{{ repositories[debian_distribution]|default([]) }}"
tags:
- files
- repos
Expand Down
5 changes: 5 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Install repositories

- include: amazon.yml
static: no
when: "ansible_distribution == 'Amazon'"

- include: centos.yml centos_distribution='centos6'
static: no
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 6"

- include: centos.yml centos_distribution='centos7'
static: no
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 7"

- include: debian.yml debian_distribution='wheezy'
static: no
when: "ansible_distribution == 'Debian' and ansible_distribution_major_version|int == 7"

- include: debian.yml debian_distribution='jessie'
static: no
when: "ansible_distribution == 'Debian' and ansible_distribution_major_version|int == 8"
6 changes: 6 additions & 0 deletions templates/centos7/docker.repo.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled={{item['enabled']|default(0)}}
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
7 changes: 7 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ repository_list:
repo: couchbase.repo
centos7:
repo: couchbase.repo
docker:
centos7:
repo: docker.repo
jessie:
key: "docker.gpg"
url: "https://apt.dockerproject.org/repo"
pool: "debian-{{ ansible_distribution_release }} main"
dotdeb:
wheezy:
key: "dotdeb.gpg"
Expand Down

0 comments on commit a31a4bc

Please sign in to comment.