From 4f3ca2c090879eaf1aa18589c17862ad5879531e Mon Sep 17 00:00:00 2001 From: "ansible-code-bot[bot]" <146274539+ansible-code-bot[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:45:53 +0000 Subject: [PATCH] Fix ansible-lint rule violations --- ansibleremoteserver.yml | 12 +-- ansibleserver.yml | 20 ++--- ansibleserver_usingbuiltinmodules.yml | 20 ++--- ansiblesharedimage.yml | 8 +- collections/requirements.yml | 2 +- roles/shadowman_dev_server/defaults/main.yml | 2 +- .../library/__pycache__/subgid.cpython-39.pyc | Bin 0 -> 3640 bytes .../library/__pycache__/subuid.cpython-39.pyc | Bin 0 -> 3636 bytes roles/shadowman_dev_server/tasks/main.yml | 70 ++++++++-------- .../defaults/main.yml | 2 +- .../tasks/main.yml | 78 +++++++++--------- .../defaults/main.yml | 2 +- .../tasks/main.yml | 6 +- .../defaults/main.yml | 4 +- .../tasks/main.yml | 6 +- .../defaults/main.yml | 2 +- .../tasks/main.yml | 56 ++++++------- 17 files changed, 145 insertions(+), 145 deletions(-) create mode 100644 roles/shadowman_dev_server/library/__pycache__/subgid.cpython-39.pyc create mode 100644 roles/shadowman_dev_server/library/__pycache__/subuid.cpython-39.pyc diff --git a/ansibleremoteserver.yml b/ansibleremoteserver.yml index 1bd5bc7..47fb898 100644 --- a/ansibleremoteserver.yml +++ b/ansibleremoteserver.yml @@ -6,13 +6,13 @@ 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 @@ -20,9 +20,9 @@ # 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 diff --git a/ansibleserver.yml b/ansibleserver.yml index 872b6ac..6ee7a07 100644 --- a/ansibleserver.yml +++ b/ansibleserver.yml @@ -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 @@ -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 diff --git a/ansibleserver_usingbuiltinmodules.yml b/ansibleserver_usingbuiltinmodules.yml index dfd832c..c78fb2e 100644 --- a/ansibleserver_usingbuiltinmodules.yml +++ b/ansibleserver_usingbuiltinmodules.yml @@ -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 @@ -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 diff --git a/ansiblesharedimage.yml b/ansiblesharedimage.yml index 9ba4742..e494c6f 100644 --- a/ansiblesharedimage.yml +++ b/ansiblesharedimage.yml @@ -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 diff --git a/collections/requirements.yml b/collections/requirements.yml index 6e8f0dc..4f9749b 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -1,5 +1,5 @@ +--- collections: - - name: community.general - name: containers.podman diff --git a/roles/shadowman_dev_server/defaults/main.yml b/roles/shadowman_dev_server/defaults/main.yml index 39d2f60..dcf4622 100644 --- a/roles/shadowman_dev_server/defaults/main.yml +++ b/roles/shadowman_dev_server/defaults/main.yml @@ -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 diff --git a/roles/shadowman_dev_server/library/__pycache__/subgid.cpython-39.pyc b/roles/shadowman_dev_server/library/__pycache__/subgid.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..77bca06bd21fba367cad0e35448df7873bcf5b39 GIT binary patch literal 3640 zcmb7H&2JmW6`$E%lFJoI$&xHvPMal}73i&K+WuxpN^#)yW67DFdGo&J zy*Ka8#?59x@T|GN;vdfv@@F&o;^ScQ7Mkp!V}#L+^yn__IlE5J-E}G9-fo3CyH%{Y zS*_>q`qbcgS$(%|-@$IcD!Wsx%4#2y-3Ien9q%R!*c9F^KFt~r9nt2kBLYhAK3Qsh z23cgu)zfiX7TG}YDDCwNp|sD^gH)zPu3LSP<|^t8@(Q{2V58-QOp=;o8jfFD{Cuj zmxJI1E<1av4DpY{k;t#)w-N+}l`J=d5KmVWgZ^k}re9*pN9&;~LWmEcqu{;bfQKDX z^j=WY5SvHvM}t%tMU@zEE5d-)lfE&75*8v=toVNr3M~u|-~%r#I-%O*A=kLkJoGYCA&xC(QVjC{eWUrH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C@#m;rx)Wg@Urhn*!U_lqXv6RbOh#v<$jyZ9j~>>YAUhjXe?%;9?ulyjqI zaqfgdGI$Q>i*v>N1?(wv)GT(UEo>FdVs>iT(|uq!%bNc)HFt21Ewfji(&2(~M)SqO z!2i0QU07P>hW^MB(Tt=m(rh1k|+FggIh5vyR1%fYw3=&=aX+6c+eY26||Akaq9BU zHqx6(!B>I^`QnH}sWIP*$v=B#HO6`Dawh6fL^ROFTFms(XVF2shbHx5>>?uX*M~Sy zj4YGiSr2vnriS{@WW_42wT;qAlZ=b=z&73Af4#1H{q<;k)K{^n){zBReuQGYij=xO z$pWi8{E(-4U)yNCy%o1NZnU?q-H7tLLFpb-IxJFAtJy)JVqv60qeRO`s3$BmvS~-W4wHxrx_ec3r%@zk zF>N&`QKy4haVc=&Bw|6YcvuN_Eo;r}C*6H6m7cZEO9XnDcfu*qgnwB@0BMP5K_xDN zOKHP%*D;U2s*I^`LR}F`rvv>YG|f%{SpI(m!V=Y z`>AC{j;>5kZH%kTnLzc((@<7>>I^l7!+hj0s%Sw#JM+{UT7`9BiTBal9g>h~Wm67v zB0bg_?u8YTrRuw-jgZ^J8FlnsvGk_*l-pts>aEyf8z1olbY*pNVGx%wOJG^D;s{qS zYqy@c5hq_K1@LS{qC3zBHefH-4(rBXU9iIu2;r1Z}g${J3F zGRMZ)5t(pi9FQTnO0lVBUen!aP8qx3hx;{a-2Xqqvb=@7rr9gs9^%o=|xHQ309@KwNSBxap{Gj zhKJ$GTtowwh;`{UicxAyM5vs=D0 z$(m~udkj>P%C&YRlh~M1T+xgI-F;VgIt<6!P8HGl38K#|cc#2|bIkRYc8FX;w}^w` Sd=') retries: 10 @@ -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: @@ -27,7 +27,7 @@ state: directory owner: root group: root - mode: '0741' + mode: "0741" when: cert_name is defined - name: Copy Cert @@ -36,7 +36,7 @@ dest: "{{ certandkeydestfolder }}{{ cert_name }}" owner: root group: wheel - mode: '0644' + mode: "0644" when: cert_name is defined - name: Copy Key @@ -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 @@ -54,26 +54,26 @@ 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 }}" @@ -81,21 +81,21 @@ - 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 }}" @@ -103,60 +103,60 @@ - 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" @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/roles/shadowman_dev_server_builtin/defaults/main.yml b/roles/shadowman_dev_server_builtin/defaults/main.yml index 39d2f60..dcf4622 100644 --- a/roles/shadowman_dev_server_builtin/defaults/main.yml +++ b/roles/shadowman_dev_server_builtin/defaults/main.yml @@ -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 diff --git a/roles/shadowman_dev_server_builtin/tasks/main.yml b/roles/shadowman_dev_server_builtin/tasks/main.yml index 8597b6d..e9648f8 100644 --- a/roles/shadowman_dev_server_builtin/tasks/main.yml +++ b/roles/shadowman_dev_server_builtin/tasks/main.yml @@ -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 @@ -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: @@ -27,7 +27,7 @@ state: directory owner: root group: root - mode: '0741' + mode: "0741" when: cert_name is defined - name: Copy Cert @@ -36,7 +36,7 @@ dest: "{{ certandkeydestfolder }}{{ cert_name }}" owner: root group: wheel - mode: '0644' + mode: "0644" when: cert_name is defined - name: Copy Key @@ -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 @@ -54,26 +54,26 @@ 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 }}" @@ -81,21 +81,21 @@ - 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 }}" @@ -103,65 +103,65 @@ - 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" - name: Allow code-server to listen on port 443 - ansible.builtin.command: "setcap cap_net_bind_service=+ep /usr/lib/code-server/lib/node" + ansible.builtin.command: setcap cap_net_bind_service=+ep /usr/lib/code-server/lib/node when: dev_server_port == 443 - name: Daemon-reload, enable and start code-server @@ -182,9 +182,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 @@ -213,7 +213,7 @@ - name: Check if EE present become: true become_user: "{{ username }}" - ansible.builtin.command: "podman image exists {{ ansible_image }}" + ansible.builtin.command: podman image exists {{ ansible_image }} register: exists changed_when: exists.rc == 1 failed_when: exists.rc > 1 @@ -221,7 +221,7 @@ - name: Pull EE only if not present become: true become_user: "{{ username }}" - ansible.builtin.command: "podman pull --creds={{ registry_user }}:{{ registry_pass }} {{ ansible_image }}" + ansible.builtin.command: podman pull --creds={{ registry_user }}:{{ registry_pass }} {{ ansible_image }} register: ee changed_when: ee.rc == 0 when: @@ -232,7 +232,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 @@ -249,24 +249,24 @@ 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 - ansible.builtin.command: "firewall-cmd --permanent --zone=public --add-port={{ dev_server_port }}/tcp" + ansible.builtin.command: firewall-cmd --permanent --zone=public --add-port={{ dev_server_port }}/tcp register: firewall changed_when: firewall.rc == 0 notify: Restart_firewalld - 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 diff --git a/roles/shadowman_dev_server_update/defaults/main.yml b/roles/shadowman_dev_server_update/defaults/main.yml index 3dc975e..04211ce 100644 --- a/roles/shadowman_dev_server_update/defaults/main.yml +++ b/roles/shadowman_dev_server_update/defaults/main.yml @@ -1,4 +1,4 @@ --- -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 _github_api_headers: "{{ {'GITHUB_TOKEN': lookup('ansible.builtin.env', 'GITHUB_TOKEN')} if (lookup('ansible.builtin.env', 'GITHUB_TOKEN')) else {} }}" diff --git a/roles/shadowman_dev_server_update/tasks/main.yml b/roles/shadowman_dev_server_update/tasks/main.yml index 2752c55..9b047d9 100644 --- a/roles/shadowman_dev_server_update/tasks/main.yml +++ b/roles/shadowman_dev_server_update/tasks/main.yml @@ -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 @@ -12,7 +12,7 @@ ansible.builtin.get_url: url: "{{ codeserver_url }}" dest: /tmp/code-server.rpm - mode: '0440' + mode: "0440" - name: Install New Code-server ansible.builtin.dnf: diff --git a/roles/shadowman_dev_shared_image_store/defaults/main.yml b/roles/shadowman_dev_shared_image_store/defaults/main.yml index d31bd06..9cc8be1 100644 --- a/roles/shadowman_dev_shared_image_store/defaults/main.yml +++ b/roles/shadowman_dev_shared_image_store/defaults/main.yml @@ -1,3 +1,3 @@ --- -ansible_image: "registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest" -additionalimagestores: "/var/lib/myee-shared" +ansible_image: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest +additionalimagestores: /var/lib/myee-shared diff --git a/roles/shadowman_dev_shared_image_store/tasks/main.yml b/roles/shadowman_dev_shared_image_store/tasks/main.yml index 22d4b6a..ef9fa5b 100644 --- a/roles/shadowman_dev_shared_image_store/tasks/main.yml +++ b/roles/shadowman_dev_shared_image_store/tasks/main.yml @@ -14,19 +14,19 @@ state: present - name: Check if EE present - ansible.builtin.command: "podman --root {{ additionalimagestores }} image exists {{ ansible_image }}" + ansible.builtin.command: podman --root {{ additionalimagestores }} image exists {{ ansible_image }} register: exists changed_when: exists.rc == 1 failed_when: exists.rc > 1 - name: Pull EE only if not present - ansible.builtin.command: "podman pull --root {{ additionalimagestores }} --creds={{ registry_user }}:{{ registry_pass }} {{ ansible_image }}" + ansible.builtin.command: podman pull --root {{ additionalimagestores }} --creds={{ registry_user }}:{{ registry_pass }} {{ ansible_image }} register: ee changed_when: ee.rc == 0 when: exists.rc == 1 - name: Ensure correct permissions if image was pulled - ansible.builtin.command: "chmod -R a+rx {{ additionalimagestores }}" + ansible.builtin.command: chmod -R a+rx {{ additionalimagestores }} register: permissions when: ee.rc == 0 changed_when: permissions.rc == 0 diff --git a/roles/shadowman_dev_vs_codeserver/defaults/main.yml b/roles/shadowman_dev_vs_codeserver/defaults/main.yml index 6645b8a..f26d13b 100644 --- a/roles/shadowman_dev_vs_codeserver/defaults/main.yml +++ b/roles/shadowman_dev_vs_codeserver/defaults/main.yml @@ -1,2 +1,2 @@ --- -commit_id: "1a5daa3a0231a0fbba4f14db7ec463cf99d7768e" +commit_id: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e diff --git a/roles/shadowman_dev_vs_codeserver/tasks/main.yml b/roles/shadowman_dev_vs_codeserver/tasks/main.yml index 698f608..89ec172 100644 --- a/roles/shadowman_dev_vs_codeserver/tasks/main.yml +++ b/roles/shadowman_dev_vs_codeserver/tasks/main.yml @@ -1,21 +1,21 @@ --- - name: Ensure VS code-server directory exists ansible.builtin.file: - path: "/home/{{ username }}/.vscode-server/bin/{{ commit_id }}/" + path: /home/{{ username }}/.vscode-server/bin/{{ commit_id }}/ recurse: true state: directory owner: "{{ username }}" - name: Ensure VS code-server data directory exists ansible.builtin.file: - path: "/home/{{ username }}//.vscode-server/data/Machine/" + path: /home/{{ username }}//.vscode-server/data/Machine/ 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 }}" @@ -23,7 +23,7 @@ - name: Download and extract Remote VS Code Server ansible.builtin.unarchive: - src: "https://update.code.visualstudio.com/commit:{{ commit_id }}/server-linux-x64/stable" + src: https://update.code.visualstudio.com/commit:{{ commit_id }}/server-linux-x64/stable dest: /home/{{ username }}/.vscode-server/bin/{{ commit_id }}/ remote_src: true extra_opts: @@ -31,21 +31,21 @@ - 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 }}" @@ -53,52 +53,52 @@ - name: Apply VS Remove Code Server defaults to Machine directory ansible.builtin.template: src: settings.json.j2 - dest: "/home/{{ username }}/.vscode-server/data/Machine/settings.json" + dest: /home/{{ username }}/.vscode-server/data/Machine/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: 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: "//home/{{ username }}/.vscode-server/bin/{{ commit_id }}/bin/code-server --install-extension redhat.ansible" + ansible.builtin.command: //home/{{ username }}/.vscode-server/bin/{{ commit_id }}/bin/code-server --install-extension redhat.ansible register: result changed_when: "'was successfully installed' in result.stdout" @@ -113,9 +113,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 @@ -144,7 +144,7 @@ - name: Check if EE present become: true become_user: "{{ username }}" - ansible.builtin.command: "podman image exists {{ ansible_image }}" + ansible.builtin.command: podman image exists {{ ansible_image }} register: exists changed_when: exists.rc == 1 failed_when: exists.rc > 1 @@ -152,7 +152,7 @@ - name: Pull EE only if not present become: true become_user: "{{ username }}" - ansible.builtin.command: "podman pull --creds={{ registry_user }}:{{ registry_pass }} {{ ansible_image }}" + ansible.builtin.command: podman pull --creds={{ registry_user }}:{{ registry_pass }} {{ ansible_image }} register: ee changed_when: ee.rc == 0 when: @@ -163,7 +163,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 @@ -180,14 +180,14 @@ src: /tmp/ansible-example/ dest: /home/{{ username }}/ansible/ansible-example owner: "{{ username }}" - mode: '0644' + mode: "0644" when: deploy_ansiblegalaxy_repo - 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