This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from jeffcpullen/devspaces-3-rhel-8
fix: backup_role enhance, docs update, rmv extra
- Loading branch information
Showing
35 changed files
with
231 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"files.associations": { | ||
"*.yaml": "ansible", | ||
"*.yml": "ansible" | ||
}, | ||
"ansible.ansible.path": "/usr/local/bin/ansible", | ||
"ansible.python.interpreterPath": "/bin/python", | ||
"ansible.ansible.useFullyQualifiedCollectionNames": true, | ||
"ansible.ansibleNavigator.path": "ansible-navigator", | ||
"ansible.completion.provideModuleOptionAliases": true, | ||
"ansible.completion.provideRedirectModules": true, | ||
"ansible.validation.enabled": true, | ||
"ansible.validation.lint.enabled": true, | ||
"ansible.validation.lint.path": "/usr/local/bin/ansible-lint" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,29 @@ NOTE: You will still need to configured your name/email globally the first time | |
git config --global user.name "Homer Simpson" | ||
git config --global user.email [email protected] | ||
``` | ||
|
||
## Sample Molecule Testing Role | ||
|
||
A sample role has been provided in the roles/backup_file directory to experiment with Test Driven Development using Molecule and OpenShift DevSpaces. A molecule verifier has been configured to test that the role functions as expected. | ||
|
||
### Automation requirements | ||
1. Make a backup of a file identified using the backup_file_source variable | ||
2. The backup should be stored in the directory identified by the backup_file_dest_folder variable | ||
3. If the backup directory doesn't exist, it should be created and writable | ||
4. The backup file should have a suffix appended such as '.bak' which is identified by the backup_file_dest_suffix variable | ||
|
||
### To begin development against the backup_file role | ||
1. Click the three horizontal bar icon in the top left of the window and select 'Terminal' -> 'New Terminal' | ||
2. Click into the terminal window | ||
3. Change directory into roles/backupfile `cd roles/backup_file` | ||
4. Run `molecule create`. This will start a test pod for the automation to run against (defined in roles/backup_file/molecule/default/molecule.yml). | ||
5. Run `oc get pods` to view the test instance that was created | ||
6. Run `molecule verify` to run the verification against the test pod and see the failures to help guide the tasks necessary in the role. | ||
7. Run `molecule converge` to run the base tasks/main.yml against the pod. This will create a backup of a file in the backup destionation folder with a suffix appended. | ||
8. Run `molecule converge` to execute the role against the test instance, and `molecule verify` to see if any tests are still failing. Repeate this until all tests pass. | ||
|
||
To reset your test pod back to a fresh instance you can run `molecule destroy` and then `molecule create` to recreate it. To run the full molecule test without stepping through each stage, run `molecule test`. | ||
|
||
## Contributing | ||
|
||
Contributions to this repository are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. You can ask any questions in the [Ansible-ZipShip-WG gchat channel](https://chat.google.com/room/AAAA8cZvmmw?cls=7) | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
--- | ||
# defaults file for backup_file | ||
backup_file_source: '/etc/hosts' | ||
backup_file_dest_folder: '/tmp/backups' | ||
backup_file_dest_suffix: '.bak' | ||
backup_file_dest_dir_owner: "{{ ansible_user_id }}" | ||
backup_file_dest_dir_group: "{{ ansible_user_gid }}" | ||
backup_file_dest_dir_mode: '0750' | ||
backup_file_dest_owner: "{{ ansible_user_id }}" | ||
backup_file_dest_group: "{{ ansible_user_gid }}" | ||
backup_file_dest_mode: '0640' | ||
backup_file_remote_source: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,24 @@ | ||
galaxy_info: | ||
author: jp | ||
author: jeffcpullen | ||
namespace: demo | ||
description: Cool description | ||
company: acme corp | ||
description: "This is an example of a non-priviledged role using kubernetes as the driver and connection method" | ||
company: Red Hat | ||
|
||
license: GPL-3 | ||
|
||
min_ansible_version: '2.14' | ||
min_ansible_version: '2.15' | ||
|
||
# If this a Container Enabled role, provide the minimum Ansible Container version. | ||
# min_ansible_container_version: | ||
|
||
# | ||
# Provide a list of supported platforms, and for each platform a list of versions. | ||
# If you don't wish to enumerate all versions for a particular platform, use 'all'. | ||
# To view available platforms and versions (or releases), visit: | ||
# https://galaxy.ansible.com/api/v1/platforms/ | ||
platforms: | ||
- name: Fedora | ||
versions: | ||
- '37' | ||
- name: Fedora | ||
versions: | ||
- all | ||
- name: EL | ||
versions: | ||
- all | ||
|
||
galaxy_tags: [] | ||
# List tags for your role here, one per line. A tag is a keyword that describes | ||
# and categorizes the role. Users find roles by searching for tags. Be sure to | ||
# remove the '[]' above, if you add tags to this list. | ||
# | ||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters. | ||
# Maximum 20 tags per role. | ||
galaxy_tags: | ||
- system | ||
- ansible | ||
- automation | ||
|
||
dependencies: [] | ||
# List your role dependencies here, one per line. Be sure to remove the '[]' above, | ||
# if you add dependencies to this list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.