Commit Graph

14 Commits

Author SHA1 Message Date
Zhao Lei
e2f4e88a55 Remove quotes from subshell call in bash script
Always no quotes for $() statement.

We don't need quotes to hold blanks in result:
 # i=$(echo 1 2 3)
 # echo $i
 1 2 3
 #

These quotes can make something wrong in some case:
 # i=$(echo '!')
 #
 # i="$(echo '!')"
 -bash: !: event not found
 #

No real problem for current code, only to use a better code style.

Change-Id: If3a914650749d72c2eb13b9f1307ef7b4319bd2f
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2015-09-23 19:14:16 +08:00
Kevin Carter
35ec780515 Rename everything for the osad to osa name change
This change updates all fo the names that we were using to the post
openstack migration name for openstack-ansible.

Change-Id: I6524af53ed02e19a0f56908e42a65d2dae8b71e3
2015-09-12 02:31:21 +01:00
Jenkins
0b01f94b55 Merge "Remove read only disks from lvm candidates" 2015-08-24 16:08:37 +00:00
David Stanek
65d620cbb7 Fixes function declarations for bashate
Change-Id: Ie631377de130cf656717fb3c8c74bdff2b8e2120
2015-08-21 11:03:12 +00:00
David Stanek
46a1638480 Fixes deprecated arithmetic expansion for bashate
$[...] is deprecated for $((...))

Change-Id: I432b6af3a04e4bb2196c53be84375a2653ae6a30
2015-08-21 10:02:02 +01:00
Jesse Pretorius
979c876378 Remove read only disks from lvm candidates
This patch removes read only disks from the candidates to be used
to store the lxc and cinder lvm volume groups.

Change-Id: I8fc0842f3629ac3c9fd01b01ecf37ffc68e3b871
Closes-Bug: #1487055
2015-08-20 15:37:05 +01:00
Jesse Pretorius
7b10c64007 Change ansible forks used
This patch changes the number of forks used by ansible when
using any of the convenience (and thus gate check) scripts
to the number of processors available on the deployment
system.

The previous values used were found to cause ssh connection
errors and it was found that reducing the number improved
the chances of success.

This patch also removes the forks setting from ansible.conf
so that ansible will use the default value when run in any
other way. This leaves the decision of setting the number
of forks to the deployer, as it should be.

Change-Id: I31ad7353344f7994063127ecfce8f4733769234c
Closes-Bug: #1479812
2015-07-30 15:11:14 +01:00
Darren Birkett
ccb1676323 add option to use dd for swapfile creation
fallocate is faster than using dd to create a thick swapfile with
zeros, but it is not supported on all filesystems (specifically ext3).

This commit adds a fallback to using dd if fallocate fails

Closes-Bug: #1458841

Change-Id: Ie4adf625d85f84a0d89a108ef0438622ab763b9d
2015-05-27 09:02:20 -07:00
Jesse Pretorius
c89ce709cc Add package list and repos to AIO diagnostics
This patch adds a listing of installed packages to the AIO diagnostic output
to assist with determining package conflicts in OpenStack CI.

Change-Id: I217c618466231f188ac1cd323ddddb8679f2d81b
2015-04-24 11:37:09 -05:00
Jesse Pretorius
954f8ff8cb Add AIO diagnostics and better gate scripts consistency
Implements extra diagnostic information for gate check failure analysis and
also appends DNS settings instead of replacing them for the AIO bootstrap.

Some extra settings are added to the DNS to try to catch edge cases for DNS
resolution. The DNS `resolv.conf` was being overwritten on every run using
google name servers however we need to add google name servers to the existing
resolver not overwrite the whole conf so a conditional was added.

The gate scripts were attempting to create a symlink to logs on every run.
While this is fine for the gate which is creates a new node on every run
the link will cause failures on recheck when doing more local testing.

The ansible log entry was being appended to the `ansible.cfg` file on every
run which should also be limited to one entry. The conditional added is
helpful when doing local testing with the gate scripts.

Closes-Bug: #1442630
Change-Id: I25aac98d7408ba32f94befea22da4471bd1697b6
2015-04-16 19:36:23 +00:00
Jesse Pretorius
8a12fee9d3 Adjust AIO swap size to 4G/8G, depending on RAM amount
The AIO setup used for the commit checks in the gate is highly resource
constrained. Currently the swap space available is 1GB and the RAM available
is 8GB. The swap size would be better set to 4G if the RAM amount is 8GB or
less, or 8G if the RAM amount is more than 8GB.

The patch switches from using dd to using fallocate for the thick loopback
file creation in order to prevent memory exhaustion when trying to create
files that are larger than the available memory.

Change-Id: I9cdb145780fb867b933890111f642a48ed7add70
Closes-Bug: #1442028
2015-04-10 16:06:28 +00:00
Jesse Pretorius
f611600fd4 Reduce script verbosity
Currently the verbose shell builtin is used, resulting in the entire
scripts contents being output in the logs. The instance information is
also output to stdout. This is unnecessarily verbose and prone to
failure. To ensure that the instance information is correctly rendered
failures from within the instance information commands will now always
return true and be logged within the `/openstack/log/ansible-logging`
directory. Each time that the function is called a new log will be
created tagged with the datecode in seconds. This commit also removes
the verbose builtin from the scripts, removes the unused
os-ansible-aio-check script.

Partial-Bug: #1425482
Change-Id: I59952d077a1a8dda12278e57a165d4bac272ed5f
2015-03-14 08:31:21 -05:00
Kevin Carter
8e6dbd01c9 Convert existing roles into galaxy roles
This change implements the blueprint to convert all roles and plays into
a more generic setup, following upstream ansible best practices.

Items Changed:
* All tasks have tags.
* All roles use namespaced variables.
* All redundant tasks within a given play and role have been removed.
* All of the repetitive plays have been removed in-favor of a more
  simplistic approach. This change duplicates code within the roles but
  ensures that the roles only ever run within their own scope.
* All roles have been built using an ansible galaxy syntax.
* The `*requirement.txt` files have been reformatted follow upstream
  Openstack practices.
* Dynamically generated inventory is now more organized, this should assist
  anyone who may want or need to dive into the JSON blob that is created.
  In the inventory a properties field is used for items that customize containers
  within the inventory.
* The environment map has been modified to support additional host groups to
  enable the seperation of infrastructure pieces. While the old infra_hosts group
  will still work this change allows for groups to be divided up into seperate
  chunks; eg: deployment of a swift only stack.
* The LXC logic now exists within the plays.
* etc/openstack_deploy/user_variables.yml has all password/token
  variables extracted into the separate file
  etc/openstack_deploy/user_secrets.yml in order to allow seperate
  security settings on that file.

Items Excised:
* All of the roles have had the LXC logic removed from within them which
  should allow roles to be consumed outside of the `os-ansible-deployment`
  reference architecture.

Note:
* the directory rpc_deployment still exists and is presently pointed at plays
  containing a deprecation warning instructing the user to move to the standard
  playbooks directory.
* While all of the rackspace specific components and variables have been removed
  and or were refactored the repository still relies on an upstream mirror of
  Openstack built python files and container images. This upstream mirror is hosted
  at rackspace at "http://rpc-repo.rackspace.com" though this is
  not locked to and or tied to rackspace specific installations. This repository
  contains all of the needed code to create and/or clone your own mirror.

DocImpact
Co-Authored-By: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
Closes-Bug: #1403676
Implements: blueprint galaxy-roles
Change-Id: I03df3328b7655f0cc9e43ba83b02623d038d214e
2015-02-18 10:56:25 +00:00
Jesse Pretorius
6b12bf3663 Implement local scripts for all gate tests
This patch implements the following:
 - scripts-library.sh which includes commonly used functions, variables
   and other preparation commands for all other scripts
 - bootstrap-ansible.sh which only deploys a selected version of ansible
   and ensures that any other requirements are prepared on the
   deployment host
 - bootstrap-aio.sh which runs all host preparation actions for an
   all-in-one build
 - gate-check-lint.sh which runs a lint and syntax check
 - gate-check-commit.sh which runs all actions required for a gate
   commit check, utilising the other scripts where required
 - run-smoke-test.sh which runs tempest from inside the utility container
 - run-playbooks.sh which runs the playbooks
 - the existing conf.d/swift.yml is renamed to be an example
   configuration - the example configurations can be used as
   documentation
 - etc/network/interfaces.d/aio_interfaces.cfg,
   etc/rpc_deploy/conf.d/swift.yml and
   etc/rpc_deploy/rpc_user_config.yml are now configurations used for
   the AIO deployment
 - a workaround for https://bugs.launchpad.net/bugs/1244589 to ensure
   that DHCP checksums are implemented by the host which is required for
   the smoke tests to work
 - the removal of the rpc heat templates as they're unusable in their
   current state
 - setting MAX_RETRIES to 0, ensuring that any failures cause an
   immediate commit check failure in the gate - this prevents the
   masking of failures by retry attempts

DocImpact
Co-Authored-By: Kevin Carter <kevin.carter@rackspace.com>
Closes-Bug: #1415883
Closes-Bug: #1417999
Closes-Bug: #1419807
Change-Id: I95242d48ad0fb055f16510803c8aa14dc183ac17
2015-02-12 15:59:11 +00:00