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>
This change updates all fo the names that we were using to the post
openstack migration name for openstack-ansible.
Change-Id: I6524af53ed02e19a0f56908e42a65d2dae8b71e3
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
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
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
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
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
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
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
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
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