Skip to content

Commit

Permalink
Fix ansible-lint rule violations
Browse files Browse the repository at this point in the history
  • Loading branch information
ansible-code-bot[bot] committed Dec 26, 2023
1 parent b8cb06b commit 4f3ca2c
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 145 deletions.
12 changes: 6 additions & 6 deletions ansibleremoteserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
vars:
# remote user not needed if using shared storage
# username for private automation hub for EE or to password protected registry
registry_user: "USERNAME"
registry_user: USERNAME
# password for private automation hub for EE or to password protected registry
registry_pass: "PASSWORD"
registry_pass: PASSWORD
# username for development server
username: "ansible"
username: ansible
# specific image to assign in ansible-navigator.yml and ansible-extension
ansible_image: "registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest"
ansible_image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
# Deploy an inventory, group variables and host variables files from files folder in role
deploy_inventory: true
# Deploy an example repository with a basic role structure
deploy_example_repo: true
# Deploy an example repository using ansible-galaxy init
deploy_ansiblegalaxy_repo: false
# location of additional image store for shared storage, must be previously set up https://access.redhat.com/solutions/6206192. Remove if not using
additionalimagestores: "/var/lib/myee-shared"
additionalimagestores: /var/lib/myee-shared
# Install VS Code locally on your laptop and then commit ID can be found in VS Code under "About Visual Studio Code"
commit_id: "1a5daa3a0231a0fbba4f14db7ec463cf99d7768e"
commit_id: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e

roles:
- shadowman_dev_vs_codeserver
20 changes: 10 additions & 10 deletions ansibleserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@

vars:
# username for private automation hub for EE or to password protected registry
registry_user: "USERNAME"
registry_user: USERNAME
# password for private automation hub for EE or to password protected registry
registry_pass: "PASSWORD"
registry_pass: PASSWORD
# password for code server, remove variable if not using auth with code server
code_server_pass: "PASSWORD"
code_server_pass: PASSWORD
# username for development server
username: "ansible"
username: ansible
# port for web server access
dev_server_port: 443
# folder to copy ssl certs from (built into EE or mounted at runtime) or localhost folder if running ansible-playbook
certandkeysourcefolder: "/certs/"
certandkeysourcefolder: /certs/
# folder to create to deploy ssl certs to
certandkeydestfolder: "/etc/pki/tls/certs/"
certandkeydestfolder: /etc/pki/tls/certs/
# name of certificate, delete if using self-signed
cert_name: "CERT.cer"
cert_name: CERT.cer
# name of key, delete if using self-signed
key_name: "KEY.key"
key_name: KEY.key
# specific image to pull to development server and assign in ansible-navigator.yml
ansible_image: "registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest"
ansible_image: registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest
# Deploy an inventory, group variables and host variables files from files folder in role
deploy_inventory: true
# Deploy an example repository with a basic role structure
Expand All @@ -33,7 +33,7 @@
# Set version to be latest or the version you want to install
version: latest
# location of additional image store for shared storage, must be previously set up https://access.redhat.com/solutions/6206192. Remove if not using
additionalimagestores: "/var/lib/mycontainers-shared"
additionalimagestores: /var/lib/mycontainers-shared

roles:
- shadowman_dev_server
20 changes: 10 additions & 10 deletions ansibleserver_usingbuiltinmodules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@

vars:
# username for private automation hub for EE or to password protected registry
registry_user: "USERNAME"
registry_user: USERNAME
# password for private automation hub for EE or to password protected registry
registry_pass: "PASSWORD"
registry_pass: PASSWORD
# password for code server, remove variable if not using auth with code server
code_server_pass: "PASSWORD"
code_server_pass: PASSWORD
# username for development server
username: "ansible"
username: ansible
# port for web server access
dev_server_port: 443
# folder to copy ssl certs from (built into EE or mounted at runtime) or localhost folder if running ansible-playbook
certandkeysourcefolder: "/certs/"
certandkeysourcefolder: /certs/
# folder to create to deploy ssl certs to
certandkeydestfolder: "/etc/pki/tls/certs/"
certandkeydestfolder: /etc/pki/tls/certs/
# name of certificate, delete if using self-signed
cert_name: "CERT.cer"
cert_name: CERT.cer
# name of key, delete if using self-signed
key_name: "KEY.key"
key_name: KEY.key
# specific image to pull to development server and assign in ansible-navigator.yml
ansible_image: "registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest"
ansible_image: registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest
# Deploy an inventory, group variables and host variables files from files folder in role
deploy_inventory: true
# Deploy an example repository with a basic role structure from git
Expand All @@ -33,7 +33,7 @@
# Set version to be latest or the version you want to install
version: latest
# location of additional image store for shared storage, must be previously set up https://access.redhat.com/solutions/6206192. Remove if not using
additionalimagestores: "/var/lib/mycontainers-shared"
additionalimagestores: /var/lib/mycontainers-shared

roles:
- shadowman_dev_server_builtin
8 changes: 4 additions & 4 deletions ansiblesharedimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

vars:
# username for private automation hub for EE or to password protected registry
registry_user: "USERNAME"
registry_user: USERNAME
# password for private automation hub for EE or to password protected registry
registry_pass: "PASSWORD"
registry_pass: PASSWORD
# specific image to pull
ansible_image: "registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest"
ansible_image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
# location of additional image store for shared storage
additionalimagestores: "/var/lib/myee-shared"
additionalimagestores: /var/lib/myee-shared

roles:
- shadowman_dev_shared_image_store
2 changes: 1 addition & 1 deletion collections/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
collections:

- name: community.general

- name: containers.podman
Expand Down
2 changes: 1 addition & 1 deletion roles/shadowman_dev_server/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: "4.18.0"
version: 4.18.0
codeserver_url: https://github.com/coder/code-server/releases/download/v{{ version }}/code-server-{{ version }}-amd64.rpm
deploy_inventory: true
deploy_example_repo: true
Expand Down
Binary file not shown.
Binary file not shown.
70 changes: 35 additions & 35 deletions roles/shadowman_dev_server/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Discover latest version of code-server
ansible.builtin.set_fact:
version: "{{ (lookup('url', 'https://api.github.com/repos/coder/code-server/releases/latest', headers=_github_api_headers,
split_lines=False) | from_json).get('tag_name') | replace('v', '') }}"
version: "{{ (lookup('url', 'https://api.github.com/repos/coder/code-server/releases/latest', headers=_github_api_headers, split_lines=False) | from_json).get('tag_name')
| replace('v', '') }}"
run_once: true
until: version is version('0.0.0', '>=')
retries: 10
Expand All @@ -12,7 +12,7 @@
ansible.builtin.get_url:
url: "{{ codeserver_url }}"
dest: /tmp/code-server.rpm
mode: '0440'
mode: "0440"

- name: Install Code Server
ansible.builtin.dnf:
Expand All @@ -27,7 +27,7 @@
state: directory
owner: root
group: root
mode: '0741'
mode: "0741"
when: cert_name is defined

- name: Copy Cert
Expand All @@ -36,7 +36,7 @@
dest: "{{ certandkeydestfolder }}{{ cert_name }}"
owner: root
group: wheel
mode: '0644'
mode: "0644"
when: cert_name is defined

- name: Copy Key
Expand All @@ -45,7 +45,7 @@
dest: "{{ certandkeydestfolder }}{{ key_name }}"
owner: root
group: wheel
mode: '0644'
mode: "0644"
when: key_name is defined

- name: Apply our systemd service file
Expand All @@ -54,109 +54,109 @@
dest: /etc/systemd/system/code-server@{{ username }}.service
owner: "{{ username }}"
group: wheel
mode: '0744'
mode: "0744"
notify: Restart_Codeserver

- name: Ensure custom facts directory exists
ansible.builtin.file:
path: "/home/{{ username }}/.local/share/code-server/User/"
path: /home/{{ username }}/.local/share/code-server/User/
recurse: true
state: directory
owner: "{{ username }}"

- name: Ensure settings directory exists
ansible.builtin.file:
path: "/home/{{ username }}/.config/code-server/"
path: /home/{{ username }}/.config/code-server/
recurse: true
state: directory
owner: "{{ username }}"

- name: Ensure podman config location exists
ansible.builtin.file:
path: "/home/{{ username }}/.config/containers/"
path: /home/{{ username }}/.config/containers/
recurse: true
state: directory
owner: "{{ username }}"
when: additionalimagestores is defined

- name: Ensure ansible directory exists
ansible.builtin.file:
path: "/home/{{ username }}/ansible/localplaybooks/"
path: /home/{{ username }}/ansible/localplaybooks/
recurse: true
state: directory
owner: "{{ username }}"

- name: Ensure ansible group vars folder exists
ansible.builtin.file:
path: "/home/{{ username }}/ansible/group_vars/"
path: /home/{{ username }}/ansible/group_vars/
recurse: true
state: directory
owner: "{{ username }}"

- name: Ensure ansible host vars folder exists
ansible.builtin.file:
path: "/home/{{ username }}/ansible/host_vars/"
path: /home/{{ username }}/ansible/host_vars/
recurse: true
state: directory
owner: "{{ username }}"

- name: Apply code server defaults
ansible.builtin.template:
src: settings.json.j2
dest: "/home/{{ username }}/.local/share/code-server/User/settings.json"
dest: /home/{{ username }}/.local/share/code-server/User/settings.json
owner: "{{ username }}"
mode: '0644'
mode: "0644"

- name: Ensure bashrc is set for user
ansible.builtin.template:
src: .bashrc.j2
dest: "/home/{{ username }}/.bashrc"
dest: /home/{{ username }}/.bashrc
owner: "{{ username }}"
mode: '0644'
mode: "0644"

- name: Apply code server settings
ansible.builtin.template:
src: config.yml.j2
dest: "/home/{{ username }}/.config/code-server/config.yaml"
dest: /home/{{ username }}/.config/code-server/config.yaml
owner: "{{ username }}"
mode: '0644'
mode: "0644"
notify: Restart_Codeserver

- name: Deploy ansible-navigator config
ansible.builtin.template:
src: ansible-navigator.yml.j2
dest: "/home/{{ username }}/ansible/ansible-navigator.yml"
dest: /home/{{ username }}/ansible/ansible-navigator.yml
owner: "{{ username }}"
mode: '0644'
mode: "0644"

- name: Deploy inventory
ansible.builtin.copy:
src: inventory
dest: "/home/{{ username }}/ansible/inventory"
dest: /home/{{ username }}/ansible/inventory
owner: "{{ username }}"
mode: '0644'
mode: "0644"
when: deploy_inventory

- name: Deploy ansible group vars folder
ansible.builtin.copy:
src: files/group_vars/
dest: "/home/{{ username }}/ansible/group_vars/"
dest: /home/{{ username }}/ansible/group_vars/
owner: "{{ username }}"
mode: '0644'
mode: "0644"
when: deploy_inventory

- name: Deploy ansible host vars folder
ansible.builtin.copy:
src: files/host_vars/
dest: "/home/{{ username }}/ansible/host_vars/"
dest: /home/{{ username }}/ansible/host_vars/
owner: "{{ username }}"
mode: '0644'
mode: "0644"
when: deploy_inventory

- name: Install ansible extension
become_user: "{{ username }}"
become: true
ansible.builtin.command: "/bin/code-server --install-extension redhat.ansible"
ansible.builtin.command: /bin/code-server --install-extension redhat.ansible
register: result
changed_when: "'was successfully installed' in result.stdout"

Expand Down Expand Up @@ -185,9 +185,9 @@
- name: Setup shared storage for podman images
ansible.builtin.template:
src: storage.conf.j2
dest: "/home/{{ username }}/.config/containers/storage.conf"
dest: /home/{{ username }}/.config/containers/storage.conf
owner: "{{ username }}"
mode: '0644'
mode: "0644"
when: additionalimagestores is defined

- name: Install ansible-navigator
Expand Down Expand Up @@ -226,7 +226,7 @@
become: true
become_user: "{{ username }}"
ansible.builtin.git:
repo: 'https://github.com/shadowman-lab/Ansible-Example.git'
repo: https://github.com/shadowman-lab/Ansible-Example.git
dest: /home/{{ username }}/ansible/ansible-example
version: main
when: deploy_example_repo
Expand All @@ -243,7 +243,7 @@
src: /tmp/ansible-example/
dest: /home/{{ username }}/ansible/ansible-example
owner: "{{ username }}"
mode: '0644'
mode: "0644"
when: deploy_ansiblegalaxy_repo

- name: Open up correct port
Expand All @@ -255,13 +255,13 @@

- name: Check if user is lingering
ansible.builtin.stat:
path: "/var/lib/systemd/linger/{{ username }}"
path: /var/lib/systemd/linger/{{ username }}
register: user_lingering

- name: Enable lingering is needed
ansible.builtin.command: "loginctl enable-linger {{ username }}"
ansible.builtin.command: loginctl enable-linger {{ username }}
when: not user_lingering.stat.exists

- name: Display Weblink
ansible.builtin.debug:
msg: "https://{{ inventory_hostname }}:{{ dev_server_port }}/?folder=/home/{{ username }}/ansible"
msg: https://{{ inventory_hostname }}:{{ dev_server_port }}/?folder=/home/{{ username }}/ansible
2 changes: 1 addition & 1 deletion roles/shadowman_dev_server_builtin/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: "4.18.0"
version: 4.18.0
codeserver_url: https://github.com/coder/code-server/releases/download/v{{ version }}/code-server-{{ version }}-amd64.rpm
deploy_inventory: true
deploy_example_repo: true
Expand Down
Loading

0 comments on commit 4f3ca2c

Please sign in to comment.