Git Product home page Git Product logo

ansible-do-freebsd-bash's Introduction

do-freebsd-bash

This role installs /usr/local/bin/bash and changes the login shell for specified user to bash (pw usermod user -s /usr/local/bin/bash)

Default login shell in FreeBSD is /bin/tcsh. This doesn't work properly with ansible as discussed in issues:

This role was tested with fresh droplet 10.3-RELEASE FreeBSD at digitalocean.com.

Requirements

Before applying this role it's necessary to change the login shell to /bin/sh

ansible do-bsd-test -e 'ansible_shell_type=csh ansible_shell_executable=/bin/csh' -a 'sudo pw usermod user -s /bin/sh'

Variables

do_freebsd_bash_user	# user whos login shell will be changed

Workflow

  1. Install the role from Ansible Galaxy https://galaxy.ansible.com/
ansible-galaxy install vbotka.ansible-do-freebsd-bash
- downloading role 'ansible-do-freebsd-bash', owned by vbotka
- downloading role from https://github.com/vbotka/ansible-do-freebsd-bash/archive/master.tar.gz
- extracting vbotka.ansible-do-freebsd-bash to /home/vlado/.ansible/roles/vbotka.ansible-do-freebsd-bash
- vbotka.ansible-do-freebsd-bash was installed successfully
  1. Edit inventory
hosts

[do-bsd-test]
139.59.214.27

[do-bsd-test:vars]
ansible_connection=ssh
ansible_user=freebsd
ansible_python_interpreter=/usr/local/bin/python2
ansible_perl_interpreter=/usr/local/bin/perl
  1. Change shell (if necessary)
ansible do-bsd-test -e 'ansible_shell_type=csh ansible_shell_executable=/bin/csh' -a 'sudo pw usermod freebsd -s /bin/sh'
139.59.214.27 | SUCCESS | rc=0 >>
  1. Edit playbook
cat ~/.ansible/playbooks/do-freebsd-bash.yml
---
- hosts: do-bsd-test
roles:
      - role: vbotka.ansible-do-freebsd-bash
  1. Run playbook
ansible-playbook ~/.ansible/playbooks/do-freebsd-bash.yml

PLAY ***************************************************************************
TASK [setup] *******************************************************************
ok: [139.59.214.27]
TASK [vbotka.ansible-do-freebsd-bash : include] ********************************
included: /home/vlado/.ansible/roles/vbotka.ansible-do-freebsd-bash/tasks/packages.yml for 139.59.214.27
TASK [vbotka.ansible-do-freebsd-bash : Install base packages] ******************
changed: [139.59.214.27]
TASK [vbotka.ansible-do-freebsd-bash : include] ********************************
included: /export/home/vlado.config/.ansible/roles/vbotka.ansible-do-freebsd-bash/tasks/shell.yml for 139.59.214.27
TASK [vbotka.ansible-do-freebsd-bash : change default shell to bash for user freebsd] ***
changed: [139.59.214.27]
PLAY RECAP *********************************************************************
139.59.214.27              : ok=5    changed=2    unreachable=0    failed=0

License

BSD

Author Information

Vladimir Botka

ansible-do-freebsd-bash's People

Contributors

vbotka avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.