-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init * passed molecule test * add matrix * asserted
- Loading branch information
Showing
10 changed files
with
189 additions
and
8 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 |
---|---|---|
|
@@ -30,6 +30,7 @@ jobs: | |
- apache-ant | ||
- jfrog | ||
- nodejs | ||
- chrome | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
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
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,9 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
|
||
collections: | ||
- merative.spm_toolbox | ||
|
||
roles: | ||
- chrome |
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,31 @@ | ||
--- | ||
driver: | ||
name: docker | ||
provider: | ||
name: docker | ||
|
||
lint: | | ||
set -e | ||
yamllint . | ||
platforms: | ||
- name: rockylinux8 | ||
image: rockylinux:8 | ||
dockerfile: ../_resources/Dockerfile.j2 | ||
pre_build_image: False | ||
privileged: True | ||
volume_mounts: | ||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw" | ||
command: "/usr/sbin/init" | ||
environment: | ||
container: docker | ||
|
||
provisioner: | ||
name: ansible | ||
log: true | ||
config_options: | ||
defaults: | ||
stderr_callback: debug | ||
stdout_callback: debug | ||
env: | ||
ANSIBLE_FORCE_COLOR: '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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# This is an example playbook to execute Ansible tests. | ||
|
||
- name: Verify | ||
hosts: all | ||
|
||
pre_tasks: | ||
- name: Check if chrome installed | ||
stat: | ||
path: "/usr/bin/google-chrome" | ||
register: chrome_check | ||
|
||
- name: Check if chromedriver installed | ||
stat: | ||
path: "/usr/local/chromedriver" | ||
register: chromedriver_installed | ||
|
||
tasks: | ||
- name: Check that chrome exists | ||
assert: | ||
that: chrome_check.stat.exists | ||
|
||
- name: Check chromedriver installed | ||
assert: | ||
that: chromedriver_installed.stat.exists |
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,39 @@ | ||
# chrome | ||
|
||
The `chrome` role downloads chrome and chromedriver appropriate for the OS. | ||
|
||
## Requirements | ||
|
||
None | ||
|
||
## Role Variables | ||
|
||
| Property Name | Default value | | ||
| ----------------- | ------------- | | ||
| `chrome_owner` | `root` | | ||
| `chrome_group` | `root` | | ||
|
||
The chrome always use `$latest` version for Linux platforms to download the latest available binary. | ||
|
||
## Dependencies | ||
|
||
None | ||
|
||
## Example Playbook | ||
|
||
``` | ||
--- | ||
- name: Install Chrome | ||
hosts: all | ||
collections: | ||
- merative.spm_toolbox | ||
roles: | ||
- chrome | ||
``` | ||
|
||
## License | ||
|
||
MIT |
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,4 @@ | ||
--- | ||
chrome_owner: 'root' | ||
chrome_group: 'root' | ||
chromedriver_version: '114.0.5735.90' # https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip |
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,39 @@ | ||
--- | ||
galaxy_info: | ||
author: SPM DevOps Team | ||
description: Download Chrome and Chromedriver appropriate for the OS. | ||
company: Merative | ||
|
||
# If the issue tracker for your role is not on github, uncomment the | ||
# next line and provide a value | ||
# issue_tracker_url: http://example.com/issue/tracker | ||
|
||
license: MIT | ||
|
||
min_ansible_version: 2.9 | ||
|
||
# | ||
# 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: EL | ||
versions: | ||
- '7' | ||
- '8' | ||
|
||
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. | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: Install required packages (wget) | ||
package: | ||
name: | ||
- wget | ||
state: latest | ||
|
||
- name: Download and Install Linux chromedriver | ||
get_url: | ||
url: "https://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_linux64.zip" | ||
dest: '/usr/local/chromedriver' | ||
owner: "{{ chrome_owner }}" | ||
group: "{{ chrome_group }}" | ||
mode: '0755' | ||
|
||
- name: Install Chrome | ||
become: yes | ||
become_user: root | ||
shell: | | ||
wget https://dl.google.com/linux/linux_signing_key.pub | ||
rpm --import linux_signing_key.pub | ||
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm | ||
dnf -y install google-chrome-stable_current_x86_64.rpm | ||
register: script_res | ||
changed_when: "'changed' in script_res.stdout" | ||
|
||
- name: Remove installation files | ||
file: | ||
path: "{{ item }}" | ||
state: absent | ||
with_items: | ||
- linux_signing_key.pub | ||
- google-chrome-stable_current_x86_64.rpm | ||
changed_when: false |