Giter Site home page Giter Site logo

ansible-ubuntu-pc's Introduction

Introduction

This Anisble playbook is designed as a toolkit to help a Ubuntu Developer, quickly setup a machine as workstation, help to deploy the developement tools for hardware enablement work.

Useful task/playbook for a Ubuntu developer

  • Quickly setup a machine with utilus for Desktop (including Google Chrome, Dropbox)

    ./deploy-playbook.sh xps-13-7390.local desktop.yml

  • Instgall Google Chrome

    ./run-task.sh u-xps-13-7390.local roles/desktop-focal/tasks/google-chrome.yaml

  • Instgall Dropbox

    ./run-task.sh u-xps-13-7390.local roles/desktop-focal/tasks/dropbox.yaml

  • Setup checkbox for PC sanity tests, which is a test suite to verify if the system are well enabled.

    ./deploy-playbook.sh xps-13-7390.local enablement.yml

  • Enable Debug Symbol Packages on Ubutnu, for analyzing stack traces or debugging.

    ./run-task.sh u-xps-13-7390.local enablement-focal/tasks/enable-ddebs.yaml

  • Enable proposed pocket to test the latest availble software for Ubutnu.

    ./run-task.sh u-xps-13-7390.local enablement-focal/tasks/enable-proposed.yaml

  • Disable screen lock/dim.

    ./run-task.sh u-xps-13-7390.local enablement-focal/tasks/disable-screenlock.yaml

  • Enable Automatic Login

    ./run-task.sh u-xps-13-7390.local enablement-focal/tasks/enable-auto-login.yaml

  • Disable background apt update.

    ./run-task.sh u-xps-13-7390.local enablement-focal/tasks/apt-periodic.yaml

  • Register HINFO/workstation on mDNS.

    ./run-task.sh u-xps-13-7390.local enablement-focal/tasks/avahi.yaml

  • Run a Checkbox test job, and fetch the report back to /tmp

    ./run-checkbox.sh u-xps-13-7390.local com.canonical.certification::smoke

    ./run-checkbox.sh u-xps-13-7390.local com.canonical.certification::graphics/gl_support

How to play

  • Install ansiable on your workstation.

    apt install ansible

  • Deploy Ubuntu on a fresh-installed machine. The mDNS/avahi is enabled by default on Ubuntu, please remember the host name you set during the installation.

  • Ensure if the machine is avaialbile on the mDNS, by checking it's IP of the hostname. (the hostname in this sample is xps-13-7390)

    avahi-resolve -n -4 -v xps-13-7390.local

  • Copy the ssh key to the target machine with ssh-copy-id

    ssh-copy-id [email protected]:

  • Add the hostnaem in the "hosts" file, Eg.

      [desktop]
      g7-7790.local ansible_ssh_user=chihchun
      xps-13-7390.local ansible_ssh_user=u ansible_sudo_pass=u
    
  • Deploy the playbook on the target machine

    ansible-playbook -v --ask-become-pass --extra-vars=hosts=xps-13-7390.local desktop.yml

    or using a helper script.

    ./deploy-playbook.sh xps-13-7390.local desktop.yml

  • Run a task on the target machine This command will run the "hello" tasks on the machine.

    ansible-playbook -vv --extra-vars=hosts=u-xps-13-7390.local -e task=enablement-focal/tasks/hello.yaml task-runner.yaml

    or using a helper script.

    ./run-task.sh xps-13-7390.local enablement-focal/tasks/hello.yaml

Known issue when playing with focal (Ubuntu 20.04)

  • The ansible 2.5.1+dfsg-1ubuntu0.1 in bionic does not work well with python3, it requires a patch.

      --- /usr/lib/python2.7/dist-packages/ansible/modules/packaging/os/apt_repository.py	2018-04-19 08:01:49.000000000 +0800
      +++ /tmp/apt_repository.py	2020-03-18 00:05:12.980457762 +0800
      @@ -188,7 +188,7 @@
                  for n, valid, enabled, source, comment in sources:
                      if valid:
                          yield file, n, enabled, source, comment
      -        raise StopIteration
      +        # raise StopIteration
      
          def _expand_path(self, filename):
              if '/' in filename:
    

ansible-ubuntu-pc's People

Contributors

chihchun avatar

Watchers

 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.