vagrant uses official fedora23 base box by default #2202
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/env python2 | ||
""" | ||
This module gathers Pulp specific Ansible facts about the remote machine. | ||
""" | ||
|
@@ -13,17 +13,23 @@ | |
stdout, stderr = pipe.communicate() | ||
pulp_27_beta_repo_enabled = 'enabled = True' in stdout | ||
|
||
# Determine if the fedora-23 repo is available yet | ||
proc = subprocess.Popen( | ||
'/usr/bin/curl -s -f https://repos.fedorapeople.org/repos/pulp/pulp/beta/2.7/fedora-23/', | ||
stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) | ||
pulp_27_beta_f23_repo_available = (proc.wait() == 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hahaha, nice There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. naw, but really it isn't |
||
|
||
# Determine if selinux is Enforcing or not | ||
pipe = subprocess.Popen('/usr/sbin/getenforce', stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, shell=True) | ||
stdout, stderr = pipe.communicate() | ||
selinux_enabled = 'Enforcing' in stdout | ||
|
||
|
||
# Build the facts for Ansible | ||
facts = { | ||
'ansible_facts': { | ||
'pulp_27_beta_repo_enabled': pulp_27_beta_repo_enabled, | ||
'pulp_27_beta_f23_repo_available': pulp_27_beta_f23_repo_available, | ||
'selinux_enabled': selinux_enabled}} | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,33 @@ | |
dest: /etc/yum.repos.d/fedora-pulp.repo | ||
|
||
- name: Enable Pulp 2.7 beta repository | ||
command: yum-config-manager --enable pulp-2.7-beta | ||
command: dnf config-manager --set-enabled pulp-2.7-beta | ||
when: pulp_27_beta_repo_enabled == false | ||
|
||
# This and its related fact should go away when we do have an f23 build, since it'll be a noop at that point | ||
- name: Rejigger the repo file if fedora 23 builds aren't available | ||
replace: | ||
dest: /etc/yum.repos.d/fedora-pulp.repo | ||
regexp: 'fedora-\$releasever' | ||
replace: fedora-22 | ||
when: not pulp_27_beta_f23_repo_available and | ||
ansible_distribution == 'Fedora' and | ||
ansible_distribution_version == '23' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sneaky! |
||
|
||
# These can go away when https://fedorahosted.org/spin-kickstarts/ticket/59 is fixed | ||
- stat: | ||
path: /etc/sudoers.d/vagrant-nopasswd | ||
name: Detect vagrant sudoers file | ||
register: vagrant_nopasswd | ||
- lineinfile: | ||
dest: "{{ vagrant_nopasswd.stat.path }}" | ||
regexp: '^vagrant' | ||
line: 'vagrant ALL=(ALL) NOPASSWD: ALL' | ||
validate: 'visudo -cf %s' | ||
mode: 0440 | ||
when: vagrant_nopasswd.stat.exists | ||
name: Rejigger vagrant sudoers file | ||
|
||
- name: Install packages | ||
dnf: name={{ item }} state=present | ||
with_items: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,15 @@ | |
- name: Install packages | ||
dnf: name={{ item }} state=present | ||
with_items: | ||
- qpid-cpp-server | ||
- qpid-cpp-server-store | ||
# qpid is broken in f23, so we have to install the compat packages: | ||
# https://bugzilla.redhat.com/show_bug.cgi?id=1286881 | ||
# - qpid-cpp-server | ||
# - qpid-cpp-server-linerstore | ||
- compat-qpid-cpp-server | ||
- compat-qpid-cpp-server-store | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these packages exist on F22? If not, we may need a when statement to do this only for F23 and do the other for F22. Or not and we can force everyone to switch boxes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The F23 box is so significantly different from purpleidea's F22 box that I opted to give up on backward compatibility between boxes. My assumption is that now that we're tracking the official fedora cloud images we've got a good excuse to start fresh at this point. |
||
- qpid-tools | ||
|
||
- name: Start and enable services | ||
service: name={{ item }} state=started enabled=yes | ||
with_items: | ||
- qpidd | ||
- qpidd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
# minimal bootstrapping before kicking off ansible: | ||
# install only what ansible needs to survive, or doesn't know how to do | ||
sudo dnf -y install python2 python2-dnf libselinux-python |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# this assumes that vda has only one partition, which contains an ext filesystem | ||
|
||
# remote-control fdisk to blindly delete and re-create the first partition on vda | ||
# (d)elete the only partition, create a (n)ew (p)rimary partition numbered (1), | ||
# accept some defaults (the two newlines), (w)rite the new table | ||
sudo fdisk /dev/vda <<EOF | ||
d | ||
n | ||
p | ||
1 | ||
|
||
|
||
w | ||
EOF | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hahaha, nice technique. |
||
|
||
# refresh partition tables | ||
sudo partprobe | ||
|
||
# fill the new space if needed | ||
sudo resize2fs /dev/vda1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
#!/usr/bin/bash | ||
|
||
# Important things: | ||
# - this file is still in-use, but deprecated in favor of ansible | ||
# - the contents of this file are being converted to ansible tasks | ||
# - add to the ansible playbook instead of adding to or altering this file | ||
# - dev-setup script calls this script after running ansible, so (despite the | ||
# unfortunate name), it is *not* vagrant-specific | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
|
||
. ~/.bashrc | ||
|
||
pushd devel | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!