]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Apt repos and package installs for ubuntu 14.04
authorAndrew Schoen <aschoen@redhat.com>
Mon, 6 Apr 2015 20:46:21 +0000 (15:46 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 16 Apr 2015 21:31:31 +0000 (16:31 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
13 files changed:
roles/testnode/tasks/apt/packages.yml [new file with mode: 0644]
roles/testnode/tasks/apt/repos.yml [new file with mode: 0644]
roles/testnode/tasks/apt_systems.yml [new file with mode: 0644]
roles/testnode/tasks/main.yml
roles/testnode/tasks/ntp.yml
roles/testnode/tasks/setup-ubuntu.yml [new file with mode: 0644]
roles/testnode/tasks/vars.yml
roles/testnode/templates/apt/ceph-redhat.pref [new file with mode: 0644]
roles/testnode/templates/apt/ceph.pref [new file with mode: 0644]
roles/testnode/templates/apt/sources.list.trusty [new file with mode: 0644]
roles/testnode/vars/apt_systems.yml
roles/testnode/vars/ubuntu.yml [new file with mode: 0644]
roles/testnode/vars/ubuntu_14.yml [new file with mode: 0644]

diff --git a/roles/testnode/tasks/apt/packages.yml b/roles/testnode/tasks/apt/packages.yml
new file mode 100644 (file)
index 0000000..5af6b26
--- /dev/null
@@ -0,0 +1,22 @@
+---
+- name: Ensure packages are not present.
+  apt:
+    name: "{{ item }}"
+    state: absent
+  with_items: 
+    - ceph_packages
+    - packages_to_remove
+
+- name: Upgrade packages
+  apt:
+    name: "{{ item }}"
+    state: latest
+  with_items: packages_to_upgrade
+  when: packages_to_upgrade|length > 0
+
+- name: Install packages
+  apt:
+    name: "{{ item }}"
+    state: present 
+  with_items: packages
+  when: packages|length > 0
diff --git a/roles/testnode/tasks/apt/repos.yml b/roles/testnode/tasks/apt/repos.yml
new file mode 100644 (file)
index 0000000..7ed5aa2
--- /dev/null
@@ -0,0 +1,51 @@
+---
+- name: Set apt preferences
+  template:
+    dest: "/etc/apt/preferences.d/{{ item }}"
+    src: "../../templates/apt/{{ item }}"
+    owner: root
+    group: root
+    mode: 0644
+  with_items:
+    - ceph.pref
+    - ceph-redhat.pref
+  register: apt_prefs
+
+- name: Add sources list
+  template:
+    dest: /etc/apt/sources.list
+    src: "../../templates/apt/sources.list.{{ ansible_distribution_release | lower }}"
+    owner: root
+    group: root
+    mode: 0644
+  register: sources
+
+- name: Install apt keys
+  apt_key:
+    url: "{{ item }}"
+    state: present
+  with_items:
+    - "http://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc;hb=HEAD"
+    - "http://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc"
+
+# required for apt_repository
+- name: Install python-apt
+  apt:
+    name: python-apt
+    state: present
+
+- name: Add local apt repos.
+  apt_repository:
+    repo: "{{ item }}"
+    state: present
+    update_cache: no 
+    mode: 0644
+  with_items: apt_repos|list + common_apt_repos|list
+  register: local_apt_repos
+
+- name: Update apt cache.
+  apt:
+    update_cache: yes
+  when: sources|changed or
+        local_apt_repos|changed or
+        apt_prefs|changed
diff --git a/roles/testnode/tasks/apt_systems.yml b/roles/testnode/tasks/apt_systems.yml
new file mode 100644 (file)
index 0000000..1cfac7e
--- /dev/null
@@ -0,0 +1,10 @@
+---
+- name: Setup local repo files.
+  include: apt/repos.yml
+  tags:
+    - repos
+
+- name: Perform package related tasks.
+  include: apt/packages.yml
+  tags:
+    - packages
index 311c4bff3559c81f3c02c45802159b202cab7b63..1d5408b83a68f7fb736a33cf5d71f2204827bc33 100644 (file)
 - include: yum_systems.yml
   when: ansible_pkg_mgr == "yum"
 
+# configure things specific to apt systems
+- include: apt_systems.yml
+  when: ansible_pkg_mgr == "apt"
+
 # configure centos specific things
 - include: setup-centos.yml
   when: ansible_distribution == "CentOS"
 - include: setup-fedora.yml
   when: ansible_distribution == "Fedora"
 
+# configure ubuntu specific things
+- include: setup-ubuntu.yml
+  when: ansible_distribution == "Ubuntu"
+
 # configure pip to use our mirror
 - include: pip.yml
   tags:
index 1c1398fdadd27b32f8c833103e81ce2bf2fcb590..6fd793e51b552e9d2d47efb981a0f845a588f8a0 100644 (file)
@@ -7,11 +7,11 @@
   tags:
     - packages
 
-- name: Install ntp package on deb based systems.
+- name: Install ntp package on apt based systems.
   apt:
     name: ntp
     state: present
-  when: ansible_pkg_mgr  == "deb"
+  when: ansible_pkg_mgr  == "apt"
   tags:
     - packages
 
diff --git a/roles/testnode/tasks/setup-ubuntu.yml b/roles/testnode/tasks/setup-ubuntu.yml
new file mode 100644 (file)
index 0000000..f40ab61
--- /dev/null
@@ -0,0 +1,5 @@
+---
+- name: Remove /etc/ceph
+  file:
+    path: /etc/ceph
+    state: absent
index 9f47d12b856f2d64d28976f1cbf5e87a8a121fe9..cc7a7045c376248d4b29b9f5512d09ba4743afdb 100644 (file)
@@ -8,6 +8,12 @@
     - "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version }}.yml"
     - empty.yml
 
+- name: Including distro specific variables.
+  include_vars: "{{ item }}"
+  with_first_found:
+    - "{{ ansible_distribution | lower }}.yml"
+    - empty.yml
+
 - name: Including version specific variables.
   include_vars: "{{ item }}"
   with_first_found:
diff --git a/roles/testnode/templates/apt/ceph-redhat.pref b/roles/testnode/templates/apt/ceph-redhat.pref
new file mode 100644 (file)
index 0000000..ec2f5b2
--- /dev/null
@@ -0,0 +1,4 @@
+{# {{ ansible_managed }} #}
+Package: *
+Pin: origin gitbuilder.ceph.redhat.com
+Pin-Priority: 998
diff --git a/roles/testnode/templates/apt/ceph.pref b/roles/testnode/templates/apt/ceph.pref
new file mode 100644 (file)
index 0000000..64d0d03
--- /dev/null
@@ -0,0 +1,4 @@
+{# {{ ansible_managed }} #}
+Package: *
+Pin: origin gitbuilder.ceph.com
+Pin-Priority: 999
diff --git a/roles/testnode/templates/apt/sources.list.trusty b/roles/testnode/templates/apt/sources.list.trusty
new file mode 100644 (file)
index 0000000..b6d862d
--- /dev/null
@@ -0,0 +1,63 @@
+# {{ ansible_managed }}
+# deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty main restricted
+
+# deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-updates main restricted
+# deb http://security.ubuntu.com/ubuntu trusty-security main restricted
+
+# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
+# newer versions of the distribution.
+deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty main restricted
+deb-src http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty main restricted
+
+## Major bug fix updates produced after the final release of the
+## distribution.
+deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-updates main restricted
+deb-src http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-updates main restricted
+
+## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
+## team. Also, please note that software in universe WILL NOT receive any
+## review or updates from the Ubuntu security team.
+deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty universe
+deb-src http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty universe
+deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-updates universe
+deb-src http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-updates universe
+
+## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
+## team, and may not be under a free licence. Please satisfy yourself as to
+## your rights to use the software. Also, please note that software in
+## multiverse WILL NOT receive any review or updates from the Ubuntu
+## security team.
+deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty multiverse
+deb-src http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty multiverse
+deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-updates multiverse
+deb-src http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-updates multiverse
+
+## N.B. software from this repository may not have been tested as
+## extensively as that contained in the main release, although it includes
+## newer versions of some applications which may provide useful features.
+## Also, please note that software in backports WILL NOT receive any review
+## or updates from the Ubuntu security team.
+deb http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
+deb-src http://apt-mirror.front.sepia.ceph.com/archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
+
+deb http://security.ubuntu.com/ubuntu trusty-security main restricted
+deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
+deb http://security.ubuntu.com/ubuntu trusty-security universe
+deb-src http://security.ubuntu.com/ubuntu trusty-security universe
+deb http://security.ubuntu.com/ubuntu trusty-security multiverse
+deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
+
+## Uncomment the following two lines to add software from Canonical's
+## 'partner' repository.
+## This software is not part of Ubuntu, but is offered by Canonical and the
+## respective vendors as a service to Ubuntu users.
+# deb http://archive.canonical.com/ubuntu trusty partner
+# deb-src http://archive.canonical.com/ubuntu trusty partner
+
+## Uncomment the following two lines to add software from Ubuntu's
+## 'extras' repository.
+## This software is not part of Ubuntu, but is offered by third-party
+## developers who want to ship their latest software.
+# deb http://extras.ubuntu.com/ubuntu trusty main
+# deb-src http://extras.ubuntu.com/ubuntu trusty main
+
index 94d1b935f5d0d73e153adc67d0a22d41289020c4..ddfe3daf9af1440fdc0c16d74576ad004049d094 100644 (file)
@@ -1,2 +1,16 @@
 ---
 ntp_service_name: ntp
+
+ceph_packages:
+  - ceph
+  - ceph-common
+  - libcephfs1
+  - radosgw
+  - python-ceph
+  - librbd1
+  - librados2
+
+packages: []
+
+apt_repos: []
+common_apt_repos: []
diff --git a/roles/testnode/vars/ubuntu.yml b/roles/testnode/vars/ubuntu.yml
new file mode 100644 (file)
index 0000000..c125e05
--- /dev/null
@@ -0,0 +1,4 @@
+---
+common_apt_repos:
+  # mod_fastcgi for radosgw
+  - "deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ansible_distribution_release}}-x86_64-basic/ref/master/ {{ansible_distribution_release}} main"
diff --git a/roles/testnode/vars/ubuntu_14.yml b/roles/testnode/vars/ubuntu_14.yml
new file mode 100644 (file)
index 0000000..78ac51c
--- /dev/null
@@ -0,0 +1,115 @@
+---
+apt_repos:
+  # blkin libraries, only trusty has new enough lttng for these
+  - "deb [arch=amd64] http://apt-mirror.front.sepia.ceph.com/blkin/ trusty main"
+  - "deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-trusty-x86_64-basic/ref/master/ trusty main"
+
+packages:
+  - blkin
+  - lttng-tools
+  # for apache
+  - libfcgi0ldbl
+  ###
+  # for s3 tests
+  - python-virtualenv
+  - python-dev
+  - libevent-dev
+  ###
+  # for cpan
+  - perl
+  - libwww-perl
+  ###
+  - lsb-release
+  - build-essential
+  - sysstat
+  - gdb
+  - python-configobj
+  - python-gevent
+  # for running ceph
+  - libedit2
+  - libssl0.9.8
+  - libgoogle-perftools4
+  - libboost-thread1.54.0
+  - cryptsetup-bin
+  - xfsprogs
+  - gdisk
+  - parted
+  ###
+  # for setting BIOS settings
+  - smbios-utils
+  ###
+  - libcrypto++9
+  - libuuid1
+  - libfcgi
+  - btrfs-tools
+  # for compiling helpers and such
+  - libatomic-ops-dev
+  ###
+  # used by workunits
+  - git-core
+  - attr
+  - dbench
+  - bonnie++
+  - iozone3
+  - valgrind
+  - python-nose
+  - mpich2
+  - mpich
+  - libmpich2-dev
+  - ant
+  ### 
+  # used by the xfstests tasks
+  - libtool
+  - automake
+  - gettext
+  - uuid-dev
+  - libacl1-dev
+  - bc
+  - xfsdump
+  - dmapi
+  - xfslibs-dev
+  - libattr1-dev
+  ###
+  - sysprof
+  - vim
+  - pdsh
+  - collectl
+  # for blktrace and seekwatcher
+  - blktrace
+  - python-numpy
+  - python-matplotlib
+  - mencoder
+  ###
+  # qemu
+  - kvm
+  - genisoimage
+  ###
+  # for json_xs to investigate JSON by hand
+  - libjson-xs-perl
+  # for pretty-printing xml
+  - xml-twig-tools
+  # for java bindings, hadoop, etc.
+  - default-jdk
+  - junit4
+  ###
+  # tgt
+  - tgt
+  - open-iscsi
+  ###
+  # for disk/etc monitoring
+  - smartmontools
+  - nagios-nrpe-server
+  ###
+  # for samba testing
+  - cifs-utils
+  # for Static IP
+  - ipcalc
+
+packages_to_upgrade:
+  - apt
+  - apache2
+  - libapache2-mod-fastcgi
+
+packages_to_remove:
+   # openmpi-common conflicts with mpitch stuff
+  - openmpi-common