Skip to content
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

Reproducibility problem #9

Open
irekkosek opened this issue Jun 12, 2023 · 1 comment
Open

Reproducibility problem #9

irekkosek opened this issue Jun 12, 2023 · 1 comment

Comments

@irekkosek
Copy link

irekkosek commented Jun 12, 2023

Hi there!
While trying to reproduce Prime's actions in https://youtu.be/qd3mfYS_Xow?t=247,
in a section related to personal projects cloning over ssh (definition in tasks/personal-projects.yml ) i came up with a
"Host key verification failed" error (due to changed execution sequence introduced in 5b1d263 to local.yml where personal-projects.yml are executed before dotfiles.yml)

I'm honestly a beginner to ansible, but i've tried to fix it and already submited a pull request. #8
It seems to work after bulding docker images and running:
docker run --rm -it nvim-computer bash
ansible-playbook -t dotfiles --ask-vault-pass local.yml
I hope contents of my pr will prove to be at least somehow heplful.

btw. Great Job on this project Prime! Keep it up!

@igavrysh
Copy link

did you manage to install ssh in docker? e.g. when I am running
local.yml

- hosts: localhost
  vars:
    source_key: "./.ssh/id_rsa"
    dest_key: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa"
    personal: "{{ lookup('env', 'HOME') }}/personal"
  pre_tasks:
  - name: Update Apt
    become: true
    apt:
      force_apt_get: true
      update_cache: true
      state: present
    tags:
      - install
      - core
  tasks:
    - include: tasks/ssh.yml

outputs:

root@93cfbf8121cd:/usr/local/bin# ansible-playbook local.yml --ask-become-pass --ask-vault-pass
BECOME password: 
Vault password: 
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks instead. This feature will be removed in version 2.16. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

PLAY [localhost] *************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************
ok: [localhost]

TASK [Update Apt] ************************************************************************************************************************
ok: [localhost]

TASK [Ensure .ssh directory exists.] *****************************************************************************************************
ok: [localhost]

TASK [Install ssh key] *******************************************************************************************************************
changed: [localhost]

TASK [Install ssh key public] ************************************************************************************************************
changed: [localhost]

TASK [Set authorized key took from file] *************************************************************************************************
failed: [localhost] (item=/root/.ssh/id_rsa.pub) => {"ansible_loop_var": "item", "changed": false, "item": "/root/.ssh/id_rsa.pub", "msg": "Failed to lookup user : \"getpwnam(): name not found: ''\""}

PLAY RECAP *******************************************************************************************************************************
localhost   

something like $USER var is not setup for root user
is there any workaround for error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants