Skip to content

novicecpp/home-config-ansible

Repository files navigation

home-config-ansible

Workstation setup scripts. All roles (except the private one) are now migrated to novicecpp.homeconfig My (Ansible) Galaxy.

Prerequisite

Packages

  • git
  • sudo
  • ssh and ssh-agent
  • ansible
  • local user with root access

Credential

Do not forget setup credentials storage before run setup.

Initial script

For Fedora, you can use init/fedora.sh script to bootstrap. For Archlinux, it is already setup in installation step archlinux/bootstrap.yml.

Setup

Create myhome directory

mkdir ~/myhome

Note: I do not do backup whole home directory, but put everything into ~/myhome directory instead to clean up the mess created by applications when reinstall OS.

Dot files will be setup later by ansible roles in home-config-ansible-private.

Setup this repo and initialize home-config-ansible-private and mygalaxy.

cd ~/myhome
git clone [email protected]:novicecpp/home-config-ansible.git
cd home-config-ansible
git submodule update --init
# install galaxy deps and symlink mygalaxy to ~/.ansible
bash mygalaxy/install.sh

Clone home-config and home-config-private to ~/myhome. Need ssh-agent to clone private repo.

CREDENTIALS_PATH=/path/to/credentials-store
eval $(ssh-agent)
ssh-add -f "${CREDENTIALS_PATH}"/private/github
cd ~/myhome
git clone [email protected]:novicecpp/home-config.git
cd home-config
git submodule update --init

Run home-config-ansible

cd ~/myhome/home-config-ansible
bash example_run.sh  # Switch playbook and inventory to the machine you run in the script.

Run home-config setup

TBD

Note

When OS packages update has linux-firmware, restart cold boot is required

For Lenovo X1/P1 Gen 2,

  • Remove power cord.
  • Restart.
  • Open bios menu > Power > Turn of built-in battery.
  • wait 5 seconds.
  • Plug in power cord, open laptop.

Development

Setup pipenv

Copy from pyenv.sh.

f_pyenv_init_pipenv ()
{
    if [[ "$#" -ne 1 ]]; then
        echo 'Error: python version required.';
        echo "Usage: ${FUNCNAME[0]} <python_version>";
        return 1;
    fi;
    PY_VERSION=${1};
    if [[ -d .venv ]]; then
        echo 'Error: .venv exists.';
        return 1;
    fi;
    export PYENV_ROOT="$HOME/.pyenv";
    command -v pyenv > /dev/null || export PATH="$PYENV_ROOT/bin:$PATH";
    eval "$(pyenv init -)";
    pyenv shell "${PY_VERSION}" || rc=$?;
    [[ $rc -ne 0 ]] && return "$rc";
    python -m venv .venv --prompt "$(basename $PWD)";
    source .venv/bin/activate;
    pip install -U pip;
    pip install pipenv
}

f_pyenv_init_pipenv 3.11 && pipenv sync

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages