-
Notifications
You must be signed in to change notification settings - Fork 22
Catch up commit to installer... #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,27 @@ | ||
| --- | ||
| # defaults file for role-install-gcloud | ||
|
|
||
| gcloud_archive_name: '' # Example: google-cloud-sdk-114.0.0-darwin-x86_64.tar.gz. If present, the archive will be downloaded. | ||
| # See https://cloud.google.com/sdk/ to find the archive name you need. | ||
| gcloud_archive_name: 'google-cloud-sdk-529.0.0-linux-x86_64.tar.gz' # Example: google-cloud-sdk-114.0.0-darwin-x86_64.tar.gz. If present, the archive will be downloaded. | ||
| # See https://cloud.google.com/sdk/ to find the archive name you need. | ||
| gcloud_tmp_path: /tmp/install_gcloud # Path where the downloaded archive can be temporarily placed | ||
| gcloud_force_download: yes # When downloading the archive, always download the archive, even if it already exists in the temp path. | ||
|
|
||
| gcloud_archive_path: '' # Path to the gcloud archive file on the Ansible controller. | ||
| gcloud_archive_path: '' # Path to the gcloud archive file on the Ansible controller. | ||
| # If present archive will be copied, not downloaded. | ||
|
|
||
| gcloud_install_path: "{{ ansible_env.HOME }}" # Path on target node where the unarchived files should land. | ||
| gcloud_install_path: "/home/njl/" # Path on target node where the unarchived files should land. | ||
|
|
||
| gcloud_usage_reporting: no # Enable usage reporting? | ||
| gcloud_profile_path: '' # Path to the user profile login script. Optional. | ||
| gcloud_command_completion: yes # Enable bash style command completion in the login script? | ||
| gcloud_update_path: yes # Update the PATH when when modifying user's login script. | ||
| gcloud_override_components: [] # Override the components that would be installed by default, and install these instead. | ||
| gcloud_override_components: [] # Override the components that would be installed by default, and install these instead. | ||
|
|
||
| gcloud_additional_components: [kubectl] # Additional components to install by default. Will either be added to the default install | ||
| # list, or to the override-components (if provided) | ||
| gcloud_debug: yes | ||
| gcloud_additional_components: [] # Additional components to install by default. Will either be added to the default install | ||
| # list, or to the override-components (if provided) | ||
| gcloud_debug: yes | ||
|
|
||
|
|
||
| gcloud_keyring_file: /usr/share/keyrings/cloud.google.gpg | ||
| gcloud_keyring_url: https://packages.cloud.google.com/apt/doc/apt-key.gpg | ||
| gcloud_keyring_tmp_file: /tmp/cloud.google.gpg |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../mkrasberry_config/roles/role-install-gcloud/files/ |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||
| - name: Copy the archive from the Ansible controller | ||||||||||||||||||||||||||||||||||||||||||
| copy: | ||||||||||||||||||||||||||||||||||||||||||
| src: "{{ gcloud_credentials }}" | ||||||||||||||||||||||||||||||||||||||||||
| dest: "/home/njl/.config/gcloud/{{ gcloud_credentials }}" | ||||||||||||||||||||||||||||||||||||||||||
| mode: 0600 | ||||||||||||||||||||||||||||||||||||||||||
| - name: Authenticate with Google Cloud | ||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.shell: | ||||||||||||||||||||||||||||||||||||||||||
| cmd: "gcloud auth login --creds-file=/home/njl/.config/gcloud/{{ gcloud_credentials }}" | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5
to
+9
|
||||||||||||||||||||||||||||||||||||||||||
| dest: "/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| mode: 0600 | |
| - name: Authenticate with Google Cloud | |
| ansible.builtin.shell: | |
| cmd: "gcloud auth login --creds-file=/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| dest: "{{ ansible_env.HOME }}/.config/gcloud/{{ gcloud_credentials }}" | |
| mode: 0600 | |
| - name: Authenticate with Google Cloud | |
| ansible.builtin.shell: | |
| cmd: "gcloud auth login --creds-file={{ ansible_env.HOME }}/.config/gcloud/{{ gcloud_credentials }}" |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coded path '/home/njl' should be replaced with a variable to make the authentication task reusable across different users.
| dest: "/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| mode: 0600 | |
| - name: Authenticate with Google Cloud | |
| ansible.builtin.shell: | |
| cmd: "gcloud auth login --creds-file=/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| dest: "{{ ansible_env.HOME }}/.config/gcloud/{{ gcloud_credentials }}" | |
| mode: 0600 | |
| - name: Authenticate with Google Cloud | |
| ansible.builtin.shell: | |
| cmd: "gcloud auth login --creds-file={{ ansible_env.HOME }}/.config/gcloud/{{ gcloud_credentials }}" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,65 +1,59 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Insure temp path exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: "{{ gcloud_tmp_path }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state: directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # download | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download the archive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| get_url: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: "{{ gcloud_archive_url }}/{{ gcloud_archive_name }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dest: "{{ gcloud_tmp_path }}/{{ gcloud_archive_name }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| force: "{{ gcloud_force_download }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: gcloud_archive_name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # copy from Ansible controller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Copy the archive from the Ansible controller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| copy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| src: "{{ gcloud_archive_path }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dest: "{{ gcloud_tmp_path }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: gcloud_archive_path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Remove existing google-cloud-sdk dir, it if exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: "{{ gcloud_install_path }}/google-cloud-sdk" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state: absent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: gcloud_archive_name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - set_fact: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| archive_path: "{{ gcloud_tmp_path + '/' + gcloud_archive_name }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: gcloud_archive_name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - set_fact: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| archive_path: "{{ gcloud_tmp_path + '/' + gcloud_archive_path | basename }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: gcloud_archive_path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Unarchive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: cd "{{ gcloud_install_path }}" && tar xvzf "{{ archive_path }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: gcloud_archive_name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build run script | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| template: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| src: "{{ role_path }}/templates/run.j2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dest: "{{ gcloud_tmp_path }}/run_install.sh" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mode: 0755 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - copy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - download | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| command: "{{ gcloud_tmp_path }}/run_install.sh" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Remove the archive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: "{{ archive_path }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state: absent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Remove the script | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: "{{ gcloud_tmp_path }}/run_install.sh" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state: absent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: not gcloud_debug | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: "Install GCloud Main" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| become: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| become_user: root | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| block: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # download | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: "Remove old key" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.file: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: "{{ gcloud_keyring_file }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state: absent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download the Keyring | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.get_url: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: "{{ gcloud_keyring_url }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dest: "{{ gcloud_keyring_tmp_file }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| force: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mode: "0644" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: DeArmor the Keyring | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.shell: "gpg --yes --batch --dearmor -o {{ gcloud_keyring_file }} {{ gcloud_keyring_tmp_file }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Somerepo | apt source | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.apt_repository: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repo: "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| filename: "google-cloud-sdk" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state: present | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install the Google Cloud SDK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.apt: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: google-cloud-cli | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state: present | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| update_cache: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache_valid_time: 84600 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| force_apt_get: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: "config cloud auth " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| become: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| become_user: "{{ local_ssh_user }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| block: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: "Add gcloud config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.file: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: "/home/njl/.config/gcloud/" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state: directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mode: "0700" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Copy the archive from the Ansible controller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.copy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| src: "{{ gcloud_credentials }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dest: "/home/njl/.config/gcloud/{{ gcloud_credentials }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mode: "0600" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Authenticate with Google Cloud | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ansible.builtin.shell: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmd: "gcloud auth login --cred-file=/home/njl/.config/gcloud/{{ gcloud_credentials }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmd: "gcloud auth login --cred-file=/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| cmd: "gcloud auth activate-service-account --key-file=/home/njl/.config/gcloud/{{ gcloud_credentials }}" |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coded path '/home/njl' should be replaced with a variable like {{ ansible_env.HOME }} or {{ local_ssh_user_home }} to make the role more reusable.
| name: "/home/njl/.config/gcloud/" | |
| state: directory | |
| mode: "0700" | |
| - name: Copy the archive from the Ansible controller | |
| ansible.builtin.copy: | |
| src: "{{ gcloud_credentials }}" | |
| dest: "/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| mode: "0600" | |
| - name: Authenticate with Google Cloud | |
| ansible.builtin.shell: | |
| cmd: "gcloud auth login --cred-file=/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| name: "{{ ('~' + local_ssh_user + '/.config/gcloud/') | expanduser }}" | |
| state: directory | |
| mode: "0700" | |
| - name: Copy the archive from the Ansible controller | |
| ansible.builtin.copy: | |
| src: "{{ gcloud_credentials }}" | |
| dest: "{{ ('~' + local_ssh_user + '/.config/gcloud/' + gcloud_credentials) | expanduser }}" | |
| mode: "0600" | |
| - name: Authenticate with Google Cloud | |
| ansible.builtin.shell: | |
| cmd: "gcloud auth login --cred-file={{ ('~' + local_ssh_user + '/.config/gcloud/' + gcloud_credentials) | expanduser }}" |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coded path '/home/njl' should be replaced with a variable like {{ ansible_env.HOME }} or {{ local_ssh_user_home }} to make the role more reusable.
| name: "/home/njl/.config/gcloud/" | |
| state: directory | |
| mode: "0700" | |
| - name: Copy the archive from the Ansible controller | |
| ansible.builtin.copy: | |
| src: "{{ gcloud_credentials }}" | |
| dest: "/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| mode: "0600" | |
| - name: Authenticate with Google Cloud | |
| ansible.builtin.shell: | |
| cmd: "gcloud auth login --cred-file=/home/njl/.config/gcloud/{{ gcloud_credentials }}" | |
| name: "{{ local_ssh_user_home }}/.config/gcloud/" | |
| state: directory | |
| mode: "0700" | |
| - name: Copy the archive from the Ansible controller | |
| ansible.builtin.copy: | |
| src: "{{ gcloud_credentials }}" | |
| dest: "{{ local_ssh_user_home }}/.config/gcloud/{{ gcloud_credentials }}" | |
| mode: "0600" | |
| - name: Authenticate with Google Cloud | |
| ansible.builtin.shell: | |
| cmd: "gcloud auth login --cred-file={{ local_ssh_user_home }}/.config/gcloud/{{ gcloud_credentials }}" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,86 @@ | ||||||
| --- | ||||||
| - block: | ||||||
| - name: Insure temp path exists | ||||||
|
||||||
| - name: Insure temp path exists | |
| - name: Ensure temp path exists |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||||||
| [core] | ||||||||||
| account = nick.lange@gmail.com | ||||||||||
| project = zeta-environs-173316 | ||||||||||
|
Comment on lines
+2
to
+3
|
||||||||||
| account = nick.lange@gmail.com | |
| project = zeta-environs-173316 | |
| account = {{ gcloud_account }} | |
| project = {{ gcloud_project }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flag
--creds-fileis incorrect. The correct flag for gcloud auth login with service account credentials is--cred-file(singular).