diff --git a/.gitignore b/.gitignore index f91a37d..596e8ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.html *.pdf +group_vars/*/local.config.yml # Created by https://www.toptal.com/developers/gitignore/api/vim,intellij # Edit at https://www.toptal.com/developers/gitignore?templates=vim,intellij diff --git a/README.adoc b/README.adoc index 45793f4..1d17456 100644 --- a/README.adoc +++ b/README.adoc @@ -1,5 +1,6 @@ = My dev-machine setup :source-highlighter: rouge +:icons: font This ansible-playbook will setup my development machines and prepare them for work. @@ -14,7 +15,7 @@ In both cases we need to install `ansible` and `git` though. sudo apt install ansible git ---- -.Prepararation on macos +.Prepararation on Macos [source,bash] ---- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" @@ -22,7 +23,19 @@ brew install ansible git ---- == Setup -The setup is simple: +Make sure to configure the local environment: +This is done by copying `global_vars/localhost/local.config.yml.tpl` to `global_vars/localhost/local.config.yml` and adjust it to the local conditions. + +[source,bash] +---- +cp global_vars/localhost/local.config.yml.tpl global_vars/localhost/local.config.yml +vi $_ +---- + +[NOTE] +We do not have installed anything yet, so we can only use the available tools of the environment. + +After the configuration the setup is very simple: [source,bash] ---- diff --git a/group_vars/localhost/local.config.yml.tpl b/group_vars/localhost/local.config.yml.tpl new file mode 100644 index 0000000..a2c4e17 --- /dev/null +++ b/group_vars/localhost/local.config.yml.tpl @@ -0,0 +1,3 @@ +# The hostname can be defined already, e.g. in a company setup, so please enter the expected hostname. +hostname: + diff --git a/roles/debian/tasks/main.yml b/roles/debian/tasks/main.yml index 087185b..15ea0a5 100644 --- a/roles/debian/tasks/main.yml +++ b/roles/debian/tasks/main.yml @@ -1,3 +1,8 @@ +- name: Ensure correct hostname + hostname: + name: "{{ hostname }}" + use: systemd + - name: Ensure tools to add additional apt sources tags: [repos] become: yes diff --git a/roles/macos/tasks/main.yml b/roles/macos/tasks/main.yml index 5ef07b9..520cae9 100644 --- a/roles/macos/tasks/main.yml +++ b/roles/macos/tasks/main.yml @@ -1,3 +1,8 @@ +- name: Ensure correct hostname + hostname: + name: "{{ hostname }}" + use: macos + - name: "Ensure brew-packages" tags: [packages] homebrew: