admin 管理员组文章数量: 1086019
Getting error when creating the ubuntu 2404 image .
FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):
File "/tmp/ansible-tmp-1743068631.520732-94183-75803486625763/AnsiballZ_apt_repository.py", line 107, in
_ansiballz_main()
File "/tmp/ansible-tmp-1743068631.520732-94183-75803486625763/AnsiballZ_apt_repository.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/tmp/ansible-tmp-1743068631.520732-94183-75803486625763/AnsiballZ_apt_repository.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible.modules.apt_repository', init_globals=dict(_module_fqn='ansible.modules.apt_repository', _modlib_path=modlib_path),
File "", line 226, in run_module
File "", line 98, in _run_module_code
File "", line 88, in _run_code
File "/tmp/ansible_apt_repository_payload_lau7f97l/ansible_apt_repository_payload.zip/ansible/modules/apt_repository.py", line 679, in
File "/tmp/ansible_apt_repository_payload_lau7f97l/ansible_apt_repository_payload.zip/ansible/modules/apt_repository.py", line 656, in main
File "/usr/lib/python3/dist-packages/apt/cache.py", line 157, in init
self.open(progress)
File "/usr/lib/python3/dist-packages/apt/cache.py", line 214, in open
self._cache = apt_pkg.Cache(progress)
^^^^^^^^^^^^^^^^^^^^^^^
apt_pkg.Error: E:Conflicting values set for option Signed-By regarding source / cloud-sdk: /usr/share/keyrings/google-cloud-archive-keyring.gpg != , E:The list of sources could not be read.
Shared connection to 127.0.0.1 closed.", "module_stdout": "", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}
Using the below ansible tasks
- name: Download the new Google Cloud GPG key
shell: |
curl -fsSL .gpg | gpg --dearmor -o /usr/share/keyrings/google-cloud-archive-keyring.gpg
args:
creates: /usr/share/keyrings/google-cloud-archive-keyring.gpg
- name: Add Google Cloud repository to APT sources
copy:
dest: /etc/apt/sources.list.d/google-cloud.list
content: |
deb [signed-by=/usr/share/keyrings/google-cloud-archive-keyring.gpg] cloud-sdk main
- name: add google sdk repository
apt_repository:
repo: "deb cloud-sdk main"
state: present
Getting error when creating the ubuntu 2404 image .
FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):
File "/tmp/ansible-tmp-1743068631.520732-94183-75803486625763/AnsiballZ_apt_repository.py", line 107, in
_ansiballz_main()
File "/tmp/ansible-tmp-1743068631.520732-94183-75803486625763/AnsiballZ_apt_repository.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/tmp/ansible-tmp-1743068631.520732-94183-75803486625763/AnsiballZ_apt_repository.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible.modules.apt_repository', init_globals=dict(_module_fqn='ansible.modules.apt_repository', _modlib_path=modlib_path),
File "", line 226, in run_module
File "", line 98, in _run_module_code
File "", line 88, in _run_code
File "/tmp/ansible_apt_repository_payload_lau7f97l/ansible_apt_repository_payload.zip/ansible/modules/apt_repository.py", line 679, in
File "/tmp/ansible_apt_repository_payload_lau7f97l/ansible_apt_repository_payload.zip/ansible/modules/apt_repository.py", line 656, in main
File "/usr/lib/python3/dist-packages/apt/cache.py", line 157, in init
self.open(progress)
File "/usr/lib/python3/dist-packages/apt/cache.py", line 214, in open
self._cache = apt_pkg.Cache(progress)
^^^^^^^^^^^^^^^^^^^^^^^
apt_pkg.Error: E:Conflicting values set for option Signed-By regarding source https://packages.cloud.google/apt/ cloud-sdk: /usr/share/keyrings/google-cloud-archive-keyring.gpg != , E:The list of sources could not be read.
Shared connection to 127.0.0.1 closed.", "module_stdout": "", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}
Using the below ansible tasks
- name: Download the new Google Cloud GPG key
shell: |
curl -fsSL https://packages.cloud.google/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/google-cloud-archive-keyring.gpg
args:
creates: /usr/share/keyrings/google-cloud-archive-keyring.gpg
- name: Add Google Cloud repository to APT sources
copy:
dest: /etc/apt/sources.list.d/google-cloud.list
content: |
deb [signed-by=/usr/share/keyrings/google-cloud-archive-keyring.gpg] https://packages.cloud.google/apt cloud-sdk main
- name: add google sdk repository
apt_repository:
repo: "deb https://packages.cloud.google/apt cloud-sdk main"
state: present
Share
Improve this question
edited Mar 27 at 14:01
Squashman
14.4k5 gold badges29 silver badges37 bronze badges
asked Mar 27 at 10:09
DeepakDeepak
214 bronze badges
3
|
1 Answer
Reset to default -1added
- name: Update package list
apt:
update_cache: yes
- name: install google sdk
apt:
name: "google-cloud-sdk"
install_recommends: no
state: present
register: result
until: result is not failed
retries: 5
delay: 5
本文标签: google cloud platformubuntu 2404 image creation failure in creation using ansibleStack Overflow
版权声明:本文标题:google cloud platform - ubuntu 2404 image creation failure in creation using ansible - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744097332a2533141.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
Conflicting values set for option Signed-By
suggests you may have a source set up for the google-cloud stuff already with a different signed-by value. – Richard Huxton Commented Mar 27 at 11:12